mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Enabled rolling file logging.
This commit is contained in:
28
NzbDrone.Web/App_Start/Logging.cs
Normal file
28
NzbDrone.Web/App_Start/Logging.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using NLog;
|
||||
using NLog.Config;
|
||||
using NzbDrone.Common;
|
||||
|
||||
[assembly: WebActivator.PreApplicationStartMethod(typeof(NzbDrone.Web.App_Start.Logging), "PreStart")]
|
||||
|
||||
namespace NzbDrone.Web.App_Start
|
||||
{
|
||||
|
||||
public static class Logging
|
||||
{
|
||||
public static void PreStart()
|
||||
{
|
||||
var enviromentProvider = new EnviromentProvider();
|
||||
|
||||
LogManager.Configuration = new XmlLoggingConfiguration(enviromentProvider.GetNlogConfigPath(), false);
|
||||
|
||||
LogConfiguration.RegisterUdpLogger();
|
||||
LogConfiguration.RegisterExceptioneer();
|
||||
LogConfiguration.RegisterConsoleLogger(LogLevel.Info, "NzbDrone.Web.MvcApplication");
|
||||
LogConfiguration.RegisterConsoleLogger(LogLevel.Info, "NzbDrone.Core.CentralDispatch");
|
||||
LogConfiguration.RegisterRollingFileLogger(enviromentProvider.GetLogFileName(), LogLevel.Trace);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user