mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-12 08:07:10 -07:00
config file based logging configuration.
This commit is contained in:
parent
0f940364a3
commit
c935db93dd
8 changed files with 2616 additions and 58 deletions
|
@ -1,5 +1,6 @@
|
|||
using NLog;
|
||||
using NLog.Config;
|
||||
using NLog.Targets;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Common;
|
||||
|
||||
|
@ -15,8 +16,10 @@ namespace NzbDrone.Test.Common
|
|||
if (LogManager.Configuration == null || LogManager.Configuration is XmlLoggingConfiguration)
|
||||
{
|
||||
LogManager.Configuration = new LoggingConfiguration();
|
||||
LogConfiguration.RegisterConsoleLogger(LogLevel.Trace);
|
||||
LogConfiguration.RegisterUdpLogger();
|
||||
var consoleTarget = new ConsoleTarget();
|
||||
consoleTarget.Layout = "${message} ${exception}";
|
||||
LogManager.Configuration.AddTarget(consoleTarget.GetType().Name, consoleTarget);
|
||||
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", consoleTarget));
|
||||
|
||||
RegisterExceptionVerification();
|
||||
LogConfiguration.Reload();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue