Dignus.Log
1.0.0
.NET 8.0
This package targets .NET 8.0. The package is compatible with this framework or higher.
.NET Framework 4.8
This package targets .NET Framework 4.8. The package is compatible with this framework or higher.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Dignus.Log --version 1.0.0
NuGet\Install-Package Dignus.Log -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Dignus.Log" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Dignus.Log" Version="1.0.0" />
<PackageReference Include="Dignus.Log" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Dignus.Log --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Dignus.Log, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Dignus.Log@1.0.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Dignus.Log&version=1.0.0
#tool nuget:?package=Dignus.Log&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Dignus.Log
Attribute-driven, zero-GC logging for the Dignus.
Fast format rendering, pluggable targets (console/file/database), and DI-backed configuration.
Highlights
- Flexible formatting:
${symbol[:format]}pipeline (ex: datetime, level, message, callsite) - Attribute mapping:
[LogElement("...")],[LogTarget("...")]auto-registration - Zero-GC composition: pooled builders, no reflection on hot paths
- Multi-target routing: per-logger rules, min level filtering
- DI integration: targets resolved via
Dignus.DependencyInjection - Graceful shutdown: buffered drain & target dispose on process exit
Built-in Format Elements
datetime(customizable format)levelmessagecallsite(filePath : lineNumber)callerFileName,callerFilePath,callerLineNumberliteral(raw text)
Built-in Targets
| Target | Key | Notes |
|---|---|---|
| Console | console |
Per-level colors, custom format |
| File | file |
Rolling: Hour / Day / Week / Month, archive naming, max archives, auto-flush, keep-open |
| Database | database |
Provider/connection/command via config, parameterized by format renderers |
Operational Notes
- Buffered write with lock-free signaling; drains on dispose
- Safe under concurrency; minimal allocations on hot path
- Default format:
${datetime} | ${level} | ${message}
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<targets>
<target id ="consoleConfig" logTarget ="console" format="${datetime} | ${level} | ${message} ${callerFileName} : ${callerLineNumber}">
<option category="color" id="Debug" value="DarkGray"/>
<option category="color" id="Info" value="Green"/>
<option category="color" id="Error" value="DarkRed"/>
<option category="color" id="Fatal" value="Red"/>
</target>
<target id="fileConfig" logTarget ="file" format="${datetime} | ${level} | ${message} | ${callerFileName} : ${callerLineNumber}">
<option category ="fileName" value="./logs/LogFile.txt"/>
<option category ="archiveFileName" value ="./logs/archive/log.{#}.txt"/>
<option category ="archiveRolling" value ="Day"/>
<option category ="maxArchiveFiles" value ="7"/>
<option category ="keepOpenFile" value="true"/>
<option category ="autoFlush" value="true"/>
</target>
<target id ="databaseConfig" logTarget="database">
<database dbConnection ="test"
dbProvider="MySql.Data.MySqlClient.MySqlConnection, MySql.Data"
keepConnectionOpen ="true"
dbCommand="insert into log (logged, level, message)
values (@logged, @level, @message);">
<option category="parameter" id="@level" value="${level}"></option>
<option category="parameter" id="@logged" value="${datetime}"></option>
<option category="parameter" id="@message" value="${message}"></option>
<option category="parameter" id="@callsite" value="${callerFileName} : ${callerLineNumber}"></option>
</database>
</target>
</targets>
<loggers>
<logger id ="consoleConfig" minLogLevel="Debug"></logger>
<logger id ="fileConfig" minLogLevel="Info"></logger>
</loggers>
</configuration>
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
| .NET Framework | net48 is compatible. net481 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Dignus.Log:
| Package | Downloads |
|---|---|
|
Dignus.Extensions.Logging
Lightweight logging extension for integrating Dignus.Log with Microsoft.Extensions.Logging |
GitHub repositories
This package is not used by any popular GitHub repositories.