Akka.Logger.NLog
1.5.69
Prefix Reserved
dotnet add package Akka.Logger.NLog --version 1.5.69
NuGet\Install-Package Akka.Logger.NLog -Version 1.5.69
<PackageReference Include="Akka.Logger.NLog" Version="1.5.69" />
<PackageVersion Include="Akka.Logger.NLog" Version="1.5.69" />
<PackageReference Include="Akka.Logger.NLog" />
paket add Akka.Logger.NLog --version 1.5.69
#r "nuget: Akka.Logger.NLog, 1.5.69"
#:package Akka.Logger.NLog@1.5.69
#addin nuget:?package=Akka.Logger.NLog&version=1.5.69
#tool nuget:?package=Akka.Logger.NLog&version=1.5.69
Akka.Logger.NLog
This is the NLog integration plugin for Akka.NET.
Configuration
Configuration via code
// Step 1. Create configuration object
var config = new NLog.Config.LoggingConfiguration();
// Step 2. Create targets and configure properties
var logconsole = new NLog.Targets.ConsoleTarget("logconsole");
logconsole.Layout = @"${date:format=HH\:mm\:ss} ${level} ${logger} ${message}";
// Step 3. Define filtering rules
config.AddRule(LogLevel.Debug, LogLevel.Fatal, logconsole);
// Step 4. Activate the configuration
NLog.LogManager.Configuration = config;
Config myConfig = @"akka.loglevel = DEBUG
akka.loggers=[""Akka.Logger.NLog.NLogLogger, Akka.Logger.NLog""]";
var system = ActorSystem.Create("my-test-system", myConfig);
Configuration via NLog.config file
Add NLog.config file to your project
<?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">
<targets>
<target name="console" xsi:type="Console" layout="[${logger}] [${level:uppercase=true}] [${event-properties:item=logSource}] [${event-properties:item=actorPath}] [${event-properties:item=threadId:format=D4}] : ${message}"/>
</targets>
<rules>
<logger name="*" minlevel="Debug" writeTo="console"/>
</rules>
</nlog>
Change your *.csproj file with this content
<ItemGroup>
<None Include="NLog.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
Change your Akka.NET configuration
Config myConfig = @"akka.loglevel = DEBUG
akka.loggers=[""Akka.Logger.NLog.NLogLogger, Akka.Logger.NLog""]";
var system = ActorSystem.Create("my-test-system", myConfig);
Configuration via Akka.Hosting
NLog can be registered as the Akka.NET logger through Akka.Hosting using the ConfigureLoggers builder method:
using Akka.Hosting;
using Akka.Logger.NLog;
// builder is a HostApplicationBuilder or WebApplicationBuilder
builder.Services.AddAkka("MySystem", configurationBuilder =>
{
configurationBuilder.ConfigureLoggers(loggerConfigBuilder =>
{
loggerConfigBuilder.ClearLoggers(); // remove Akka's default console logger
loggerConfigBuilder.AddLogger<NLogLogger>(); // route Akka events into NLog
});
});
NLog targets and rules are still configured as usual—either via NLog.config file or programmatically (both methods are shown in the sections above).
For a complete runnable example, see the demo project at src/Examples/Akka.Logger.NLog.HostingDemo.
Maintainer
- Akka.NET Team
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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 Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
NuGet packages (19)
Showing the top 5 NuGet packages that depend on Akka.Logger.NLog:
| Package | Downloads |
|---|---|
|
Akka.NLog
DEPRECATED. Use Akka.Logger.NLog instead. If you're upgrading from a previous version, this package contains instructions on how to upgrade to Akka.Logger.NLog. |
|
|
Intent.Esb.Server
Intent Esb Server Library |
|
|
FAkka.Shared
Package Description |
|
|
AkkaSim
DES Simulation implementation, with pesimistic central clock |
|
|
AkkaDotModule.Webnori
Package Description |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Akka.Logger.NLog:
| Repository | Stars |
|---|---|
|
superquanter/quanter
从原来的StockTrader迁移过来
|
| Version | Downloads | Last Updated |
|---|---|---|
| 1.5.69 | 1,076 | 6/16/2026 |
| 1.5.60 | 10,456 | 2/10/2026 |
| 1.5.59 | 1,990 | 1/27/2026 |
| 1.5.57-beta2 | 489 | 12/4/2025 |
| 1.5.41 | 34,965 | 5/15/2025 |
| 1.5.13 | 252,027 | 9/27/2023 |
| 1.5.0 | 46,550 | 3/6/2023 |
| 1.4.10 | 292,347 | 10/29/2020 |
| 1.4.5 | 39,870 | 5/4/2020 |
| 1.3.5 | 38,317 | 1/28/2020 |
| 1.3.4 | 6,136 | 1/12/2020 |
| 1.3.3 | 157,489 | 8/1/2018 |
| 1.3.1 | 41,365 | 5/7/2018 |
| 1.3.0-beta | 7,132 | 8/31/2017 |
| 1.2.0 | 68,030 | 4/25/2017 |
| 1.1.2 | 44,042 | 10/26/2016 |
| 1.1.1 | 35,487 | 7/20/2016 |
| 1.0.8 | 18,565 | 4/28/2016 |
| 1.0.7 | 13,720 | 4/7/2016 |
| 1.0.6 | 15,387 | 1/18/2016 |
**New Features**
* [Add Akka.Hosting integration demo and integration tests](https://github.com/akkadotnet/Akka.Logger.NLog/pull/260) - Includes a working end-to-end sample showing how to wire up Akka.Logger.NLog via `Akka.Hosting`, along with integration tests covering the hosted setup.
* [Document Akka.Hosting setup in README](https://github.com/akkadotnet/Akka.Logger.NLog/pull/261) - README now includes a dedicated section explaining how to configure Akka.Logger.NLog through `Akka.Hosting`, making it easier to get started in modern .NET host environments.
**Dependency Updates**
* [Upgraded to Akka.NET v1.5.69](https://github.com/akkadotnet/Akka.Logger.NLog/pull/262)