akkadotnet - Akka.Logger.NLog 1.3.0-beta13

NLog logging adapter for Akka.NET

PM> Install-Package Akka.Logger.NLog -Version 1.3.0-beta13 -Source https://www.myget.org/F/akkadotnet/api/v3/index.json

Copy to clipboard

> nuget.exe install Akka.Logger.NLog -Version 1.3.0-beta13 -Source https://www.myget.org/F/akkadotnet/api/v3/index.json

Copy to clipboard

> dotnet add package Akka.Logger.NLog --version 1.3.0-beta13 --source https://www.myget.org/F/akkadotnet/api/v3/index.json

Copy to clipboard
<PackageReference Include="Akka.Logger.NLog" Version="1.3.0-beta13" />
Copy to clipboard
source https://www.myget.org/F/akkadotnet/api/v3/index.json

nuget Akka.Logger.NLog  ~> 1.3.0-beta13
Copy to clipboard

> choco install Akka.Logger.NLog --version 1.3.0-beta13 --source https://www.myget.org/F/akkadotnet/api/v2

Copy to clipboard
Import-Module PowerShellGet
Register-PSRepository -Name "akkadotnet" -SourceLocation "https://www.myget.org/F/akkadotnet/api/v2"
Install-Module -Name "Akka.Logger.NLog" -RequiredVersion "1.3.0-beta13" -Repository "akkadotnet" -AllowPreRelease
Copy to clipboard

Akka.Logger.NLog

Build status NuGet Version

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);

Maintainer

  • Akka.NET Team

Support for Akka 1.3.0 and .NET Core

  • .NETFramework 4.5
    • Akka (>= 1.3.0)
    • NLog (>= 5.0.0-beta09)
  • .NETStandard 1.6
    • Akka (>= 1.3.0)
    • NETStandard.Library (>= 1.6.1)
    • NLog (>= 5.0.0-beta09)
  • .NETFramework 4.5: 4.5.0.0
  • .NETStandard 1.6: 1.6.0.0

Owners

Aaron Stannard Andrew Skotzko

Authors

Akka.NET Contrib

Project URL

https://github.com/AkkaNetContrib/Akka.Logger.NLog

License

Apache-2.0

Tags

akka actors actor model Akka concurrency NLog

Info

7 total downloads
1 downloads for version 1.3.0-beta13
Download (9.65 KB)
Found on the current feed only

Package history

Version Size Last updated Downloads Mirrored?
1.3.3-beta21 10.78 KB Tue, 17 Jul 2018 12:14:35 GMT 3
1.3.3-beta20 10.78 KB Mon, 16 Jul 2018 12:14:22 GMT 0
1.3.1-beta19 10.78 KB Sun, 01 Jul 2018 12:15:26 GMT 0
1.3.1-beta18 10.02 KB Mon, 07 May 2018 17:26:59 GMT 0
1.3.1-beta17 10.02 KB Sat, 05 May 2018 12:15:34 GMT 0
1.3.1-beta16 9.68 KB Wed, 04 Apr 2018 12:21:18 GMT 0
1.3.0-beta15 9.65 KB Tue, 03 Apr 2018 12:17:13 GMT 0
1.3.0-beta14 9.65 KB Tue, 12 Sep 2017 12:11:34 GMT 3
1.3.0-beta13 9.65 KB Thu, 31 Aug 2017 12:11:34 GMT 1
1.3.0-beta12 9.6 KB Tue, 29 Aug 2017 12:13:32 GMT 0