![]() |
VOOZH | about |
dotnet add package Plinth.Logging.NLog --version 1.8.1
NuGet\Install-Package Plinth.Logging.NLog -Version 1.8.1
<PackageReference Include="Plinth.Logging.NLog" Version="1.8.1" />
<PackageVersion Include="Plinth.Logging.NLog" Version="1.8.1" />Directory.Packages.props
<PackageReference Include="Plinth.Logging.NLog" />Project file
paket add Plinth.Logging.NLog --version 1.8.1
#r "nuget: Plinth.Logging.NLog, 1.8.1"
#:package Plinth.Logging.NLog@1.8.1
#addin nuget:?package=Plinth.Logging.NLog&version=1.8.1Install as a Cake Addin
#tool nuget:?package=Plinth.Logging.NLog&version=1.8.1Install as a Cake Tool
NLog logging via Plinth
NLog.config in your project root. <ItemGroup>
<None Update="NLog.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<?xml version="1.0" encoding="utf-8"?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd" autoReload="true" throwExceptions="false" internalLogLevel="Off"
internalLogFile="Logs/nlog-internal.log">
<variable name="product" value="PRODUCT" />
<variable name="component" value="COMPONENT" />
-->
<variable name="exceptionRootDirPrefixes" value="Plinth,YourNamespace" />
<include file="${basedir}/NLog.Plinth.config" ignoreErrors="true" />
<rules>
</rules>
</nlog>
local, dev, prod, etc public static class Program
{
public static void Main(string[] args)
{
var log = StaticLogManagerSetup.BasicNLogSetup();
log.Debug("startup!");
webBuilder.ConfigureLogging(builder => builder.AddNLog());
OR
webBuilder.ConfigureServices(services => services.AddNLog());
using Microsoft.Extensions.Logging;
class MyClass
{
private static readonly ILogger log = StaticLogManager.GetLogger();
OR inject via DI
public MyClass(ILogger<MyClass> logger)
By default, Microsoft.* and System.* will be set to Warn and above only.
To turn those on, add rules in NLog.config like this, which will enable Info and above
<logger name="Microsoft.*" maxLevel="Debug" final="true" />
👉 NOTE: When using NLog, appsettings.json / "Logging" has no effect, it is all configured through NLog.config
Use this to override file archiving parameters in NLog.Plinth.config
NLog.Plinth.Overrides.config in your root.Copy If Newer{Project}.csproj
<ItemGroup>
<None Update="NLog.Plinth.Overrides.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<?xml version="1.0" encoding="utf-8"?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd" autoReload="true" throwExceptions="false" internalLogLevel="Off"
internalLogFile="Logs\nlog-internal.log">
<variable name="file.archiveAboveSize" value="10485760"/>
<variable name="file.maxArchiveFiles" value="10"/>
<variable name="file.enableCompression" value="true"/>
</nlog>
<variable name="plinthOverrideConfig" value="NLog.Plinth.Overrides.PROD.config"/>
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 2 NuGet packages that depend on Plinth.Logging.NLog:
| Package | Downloads |
|---|---|
|
Plinth.Logging.NLog.AppInsights
Plinth NLog Target for Application Insights |
|
|
Plinth.WindowsService
Plinth Windows Service Utilities |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.8.1 | 3,283 | 12/11/2025 |
| 1.8.0 | 738 | 11/13/2025 |
| 1.8.0-b211.72089fd9 | 286 | 11/12/2025 |
| 1.7.4 | 4,480 | 8/6/2025 |
| 1.7.3 | 172 | 8/2/2025 |
| 1.7.2 | 674 | 3/16/2025 |
| 1.7.1 | 977 | 12/12/2024 |
| 1.7.0 | 9,672 | 11/12/2024 |
| 1.6.6 | 298 | 11/8/2024 |
| 1.6.5 | 3,142 | 8/31/2024 |
| 1.6.4 | 259 | 8/2/2024 |
| 1.6.3 | 574 | 5/15/2024 |
| 1.6.2 | 436 | 2/16/2024 |
| 1.6.1 | 4,873 | 1/5/2024 |
| 1.6.0 | 486 | 11/30/2023 |
| 1.5.10-b186.aca976b4 | 197 | 11/30/2023 |
| 1.5.9 | 277 | 11/29/2023 |
| 1.5.9-b174.64153841 | 171 | 11/23/2023 |
| 1.5.9-b172.dfc6e7bd | 174 | 11/17/2023 |
| 1.5.9-b171.4e2b92e2 | 188 | 11/4/2023 |
net10.0 support