The Wiki is vague in describing how to configure a logger. I'm using
var config = ConfigurationFactory.ParseString(@"
akka {
loggers = [""Akka.NLog.Event.NLog.NLogLogger,Akka.NLog""]
stdout-loglevel = INFO
loglevel = INFO
log-config-on-start = on
}"
);
and have installed Akka.NLog from Nuget but get an exception when I create the actor system stating 'Logger specified in config cannot be found: "Akka.NLog.Event.NLog.NLogLogger,Akka.NLog"'.
What is the correct configuration string for a contrib logger?
The correct HOCON configuration should look like this:
akka {
loggers = ["Akka.Logger.NLog.NLogLogger,Akka.Logger.NLog"]
}
To configure a custom logger, you just need to pass in a FQN into the akka.loggers
HOCON field.
So if you want to use a user-defined logger Foo.Loggers.MyCustomLogger
in assembly Foo.Loggers
AND your original NLog logger, your HOCON will look like this:
akka {
loggers = ["Foo.Loggers.MyCustomLogger,Foo.Loggers","Akka.Logger.NLog.NLogLogger,Akka.Logger.NLog"]
}
Your exception points out, that fully qualified type name for logger you've used is not correct. Either you haven't provided correct assembly in your project, or type name is invalid.
At the present moment Akka logger with NLog support is now accessible with:
install-package Akka.Logger.NLog
NLog logger itself is accessible with Akka.Logger.NLog.NLogLogger, Akka.Logger.NLog
fully qualified name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With