An open API service indexing awesome lists of open source software.

https://github.com/akkadotnet/akka.logger.nlog

Akka.NET logging integration for NLog library
https://github.com/akkadotnet/akka.logger.nlog

akka akkadotnet nlog

Last synced: 3 months ago
JSON representation

Akka.NET logging integration for NLog library

Awesome Lists containing this project

README

          

# Akka.Logger.NLog
[![Build status](https://dev.azure.com/dotnet/Akka.NET/_apis/build/status/189)](https://dev.azure.com/dotnet/Akka.NET/_build?definitionId=189) [![NuGet Version](http://img.shields.io/nuget/v/Akka.Logger.NLog.svg?style=flat)](https://www.nuget.org/packages/Akka.Logger.NLog/)

This is the NLog integration plugin for Akka.NET.

## Configuration

### Configuration via code
```C#
// 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







```

Change your *.csproj file with this content
```xml


Always

```

Change your Akka.NET configuration
```C#
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