KamiSama.Extensions.NLog
10.0.11.8
See the version list below for details.
dotnet add package KamiSama.Extensions.NLog --version 10.0.11.8
NuGet\Install-Package KamiSama.Extensions.NLog -Version 10.0.11.8
<PackageReference Include="KamiSama.Extensions.NLog" Version="10.0.11.8" />
<PackageVersion Include="KamiSama.Extensions.NLog" Version="10.0.11.8" />
<PackageReference Include="KamiSama.Extensions.NLog" />
paket add KamiSama.Extensions.NLog --version 10.0.11.8
#r "nuget: KamiSama.Extensions.NLog, 10.0.11.8"
#:package KamiSama.Extensions.NLog@10.0.11.8
#addin nuget:?package=KamiSama.Extensions.NLog&version=10.0.11.8
#tool nuget:?package=KamiSama.Extensions.NLog&version=10.0.11.8
KamiSama.Extensions.NLog
Version: 10.0.0
Description
Provides three NLog layout renderers for Persian-calendar timestamps and an IFileCompressor implementation for creating password-protected ZIP archives through SharpZipLib. Use it with the surrounding package APIs when composing application code.
How to use
dotnet add package KamiSama.Extensions.NLog --version 10.0.0
Register the extension assembly in NLog.config, then select the renderer that matches the required timestamp shape:
<nlog>
<extensions>
<add assembly="KamiSama.Extensions.NLog" />
</extensions>
<targets>
<target xsi:type="File" name="file" fileName="${baseDir}/app.log"
layout="${persian-date:format=yyyy/MM/dd HH\:mm\:ss.fff} ${message}" />
</targets>
</nlog>
The available renderer names are persian-date, persian-longDate, and persian-shortDate. To password-protect archives, assign the NLog file compressor in application startup:
using KamiSama.Extensions.NLog;
using NLog.Targets;
string archivePassword = Environment.GetEnvironmentVariable("NLOG_ARCHIVE_PASSWORD")
?? throw new InvalidOperationException("NLOG_ARCHIVE_PASSWORD is not configured.");
PasswordFunc passwordFunc = (fileName, archiveFileName) => archivePassword;
ConcurrentFileTarget.FileCompressor = new EncryptedZipArchiveFileCompressor(passwordFunc);
Resolve archive passwords from a secret store or protected configuration. Never hardcode them in source code or NLog.config.
Namespaces
- KamiSama.Extensions.NLog (5 types)
Types
- KamiSama.Extensions.NLog.EncryptedZipArchiveFileCompressor - Implements NLog archive compression by adding log files to password-protected ZIP archives with SharpZipLib. Assign an instance to
ConcurrentFileTarget.FileCompressorwhen encrypted archive entries are required. - KamiSama.Extensions.NLog.PasswordFunc - Resolves the password used when a log file is added to a ZIP archive. Use it with the surrounding package APIs when composing application code.
- KamiSama.Extensions.NLog.PersianDateLayoutRenderer - Renders an NLog event timestamp with a configurable Persian-calendar date and time format. Use
Formatto select the output accepted by the Persian date formatting extensions. - KamiSama.Extensions.NLog.PersianLongDateLayoutRenderer - Renders an NLog event timestamp as a Persian-calendar date with time and four fractional-second digits. The fixed output format is
yyyy-MM-dd HH:mm:ss.ffff. - KamiSama.Extensions.NLog.PersianShortDateLayoutRenderer - Renders the date portion of an NLog event timestamp using the Persian calendar. The fixed output format is
yyyy-MM-dd.
| 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
- KamiSama.Extensions.Core (>= 10.0.11.8)
- NLog.Targets.ConcurrentFile (>= 6.0.3)
- SharpZipLib (>= 1.4.2)
- System.Drawing.Common (>= 10.0.11)
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.11.9 | 88 | 8/24/2026 |
| 10.0.11.8 | 81 | 8/21/2026 |
| 10.0.11.7 | 101 | 8/21/2026 |
| 10.0.11.6 | 94 | 8/19/2026 |
| 10.0.11.5 | 77 | 8/18/2026 |
| 10.0.11.4 | 92 | 8/18/2026 |
| 10.0.11.3 | 90 | 8/18/2026 |
| 10.0.11.2 | 93 | 8/18/2026 |
| 10.0.11.1 | 94 | 8/15/2026 |
| 10.0.11 | 90 | 8/11/2026 |
| 10.0.10.2 | 104 | 8/4/2026 |
| 10.0.10.1 | 111 | 7/31/2026 |
| 10.0.10 | 111 | 7/30/2026 |
| 10.0.9 | 124 | 6/20/2026 |
| 10.0.7 | 122 | 5/1/2026 |
| 10.0.6 | 128 | 4/16/2026 |
| 10.0.1 | 263 | 11/26/2025 |
| 10.0.0 | 286 | 11/22/2025 |
| 3.1.6 | 266 | 11/7/2025 |
| 3.1.5 | 251 | 11/6/2025 |