ToolsToLive.Logging
10.0.0
See the version list below for details.
dotnet add package ToolsToLive.Logging --version 10.0.0
NuGet\Install-Package ToolsToLive.Logging -Version 10.0.0
<PackageReference Include="ToolsToLive.Logging" Version="10.0.0" />
<PackageVersion Include="ToolsToLive.Logging" Version="10.0.0" />
<PackageReference Include="ToolsToLive.Logging" />
paket add ToolsToLive.Logging --version 10.0.0
#r "nuget: ToolsToLive.Logging, 10.0.0"
#:package ToolsToLive.Logging@10.0.0
#addin nuget:?package=ToolsToLive.Logging&version=10.0.0
#tool nuget:?package=ToolsToLive.Logging&version=10.0.0
ToolsToLive.Logging
versioning: 10.2.4, where
- 10 supported .Net version
- 2 library major version
- 4 library minor version
Configuration example
{
"LogsSettings": {
"ApplicationName": "AppName",
"MinimumLevel": "Information",
"NamespaceMinimumLevels": [
{
"Namespace": "Microsoft",
"MinimumLevel": "Warning"
}
],
"ConsoleSinkSettings": {
"Enabled": true,
"RestrictedToMinimumLevel": "Warning",
"Format": "Text"
},
"FileSinkSettings": {
"Enabled": false,
"Path": "logfiles/mylog_.log",
"Format": "Json"
},
"HttpSinkSettings": {
"Enabled": false,
"RequestUri": ""
},
"ElasticSinkSettings": {
"Enabled": false,
"RequestUri": "http://elasticsearch:9200",
"IgnoreCertificateValidation": true,
"UserName": "elastic",
"Password": "*************"
}
}
}
A complete example with every setting is in config.example.json.
Output format
Format of the console and file sinks:
Text(default) — text rendered byOutputTemplateor the built-in template.Json— one line of compact JSON (CLEF) per event, written byRenderedCompactJsonFormatterfromSerilog.Formatting.Compact.OutputTemplateis ignored. A multi-line exception stays inside one line, so a container log collector keeps the event as a single record.
The fields of a JSON event:
| Field | Value |
|---|---|
@t |
Timestamp, ISO 8601 in UTC |
@m |
Rendered message |
@i |
Event id: hash of the message template |
@l |
Level; omitted for Information |
@x |
Exception with stack trace, if any |
@tr, @sp |
Trace id and span id of Activity.Current when the event was written, if any |
| other | Event properties: template values, SourceContext, log context and scopes (RequestId in ASP.NET Core), ThreadId, MachineName, Application |
Unlike {Message:lj} of the text templates, @m puts string values in quotes: User "John" signed in. A template that already quotes a placeholder gets doubled quotes. Numbers and dates in @m use the invariant culture, as in the text output. The values themselves are also written as separate properties.
The file sink keeps buffering, daily rolling and the retention limit in both formats.
How to use
var builder = WebApplication.CreateBuilder(args);
builder.Host.UseSerilog((context, loggerConfiguration) =>
{
loggerConfiguration.ConfigureLogging(context.Configuration.GetSection("LogsSettings"));
});
| 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
- Elastic.Serilog.Sinks (>= 8.19.0)
- Newtonsoft.Json (>= 13.0.4)
- Serilog.AspNetCore (>= 10.0.0)
- Serilog.Enrichers.Environment (>= 3.0.1)
- Serilog.Enrichers.Thread (>= 4.0.0)
- Serilog.Formatting.Compact (>= 3.0.0)
- Serilog.Sinks.Http (>= 9.2.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.2 | 0 | 11/13/2026 |
| 10.0.1 | 109 | 11/5/2026 |
| 10.0.0 | 115 | 10/26/2026 |
| 10.0.0-alpha.12 | 121 | 2/9/2026 |
| 1.1.0-alpha.10 | 89 | 2/9/2026 |
| 1.0.1 | 926 | 3/20/2022 |
| 1.0.1-alpha.2 | 298 | 3/17/2022 |