AStarDev.LoggingSerilog
0.1.1
dotnet add package AStarDev.LoggingSerilog --version 0.1.1
NuGet\Install-Package AStarDev.LoggingSerilog -Version 0.1.1
<PackageReference Include="AStarDev.LoggingSerilog" Version="0.1.1" />
<PackageVersion Include="AStarDev.LoggingSerilog" Version="0.1.1" />
<PackageReference Include="AStarDev.LoggingSerilog" />
paket add AStarDev.LoggingSerilog --version 0.1.1
#r "nuget: AStarDev.LoggingSerilog, 0.1.1"
#:package AStarDev.LoggingSerilog@0.1.1
#addin nuget:?package=AStarDev.LoggingSerilog&version=0.1.1
#tool nuget:?package=AStarDev.LoggingSerilog&version=0.1.1
AStarDev.LoggingSerilog
Serilog logger configuration helper: console + rolling JSON file sinks, driven by IConfigurationRoot.
Installation
dotnet add package AStarDev.LoggingSerilog
Or via the NuGet Package Manager in Visual Studio / Rider.
Available extensions
SerilogConfigurator.CreateLogger(configuration, logFilePath, rollingInterval = Day, retainedFileCountLimit = 7)
Builds an ILogger that:
- reads sink/level settings from the supplied
IConfigurationRoot(ReadFrom.Configuration) - writes to the console (invariant culture format)
- writes JSON-formatted log events to
logFilePath, rolling onrollingIntervaland keepingretainedFileCountLimitfiles, shared across processes, flushed to disk every second
Build
This package lives inside the astar-dev-mono mono-repo and inherits all build configuration from the root Directory.Build.props.
# From the repo root — builds everything
dotnet build
# Build only this package
dotnet build packages/core/logging/AStarDev.LoggingSerilog
# If Directory.Build.props changes aren't being picked up
dotnet clean && dotnet build packages/core/logging/AStarDev.LoggingSerilog
Test
Tests for this package live alongside it in AStarDev.LoggingSerilog.Tests.Unit.
# Run all tests
dotnet test
# Run tests for this package specifically
dotnet test packages/core/logging/AStarDev.LoggingSerilog.Tests.Unit
Contributing
- Fork the repo and create a branch:
feat/logging-serilog-<short-description>orfix/logging-serilog-<short-description>. - Follow the Conventional Commits format — e.g.
feat(packages/core/logging/AStarDev.LoggingSerilog): add XyzExtensions. - All warnings are treated as errors (
TreatWarningsAsErrors=true), so the build must stay clean. - Add or update the relevant doc file under
docs/if you add a new extension or change an existing one. - Open a PR against
main. CI runs automatically on push.
Do not run dotnet pack or dotnet nuget push manually — releases are triggered by pushing a v* tag. See the repo-level Releasing a new version guide.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.Extensions.Configuration (>= 10.0.9)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.9)
- Microsoft.Extensions.Configuration.FileExtensions (>= 10.0.9)
- Microsoft.Extensions.Configuration.Json (>= 10.0.9)
- Serilog (>= 4.3.1)
- Serilog.Settings.Configuration (>= 10.0.1)
- Serilog.Sinks.Console (>= 6.1.1)
- Serilog.Sinks.File (>= 7.0.0)
- System.Reactive (>= 6.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release.