2012-01-22 18:24:16 -08:00
|
|
|
using System.Linq;
|
|
|
|
using NLog;
|
|
|
|
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()
|
|
|
|
{
|
2012-03-06 18:59:43 -08:00
|
|
|
var environmentProvider = new EnvironmentProvider();
|
2012-01-22 18:24:16 -08:00
|
|
|
|
2013-01-19 17:00:20 -08:00
|
|
|
//LogManager.Configuration = new XmlLoggingConfiguration(environmentProvider.GetNlogConfigPath(), false);
|
2012-01-22 18:24:16 -08:00
|
|
|
|
|
|
|
LogConfiguration.RegisterUdpLogger();
|
2012-02-04 22:34:36 -08:00
|
|
|
LogConfiguration.RegisterRemote();
|
2012-01-22 18:24:16 -08:00
|
|
|
LogConfiguration.RegisterConsoleLogger(LogLevel.Info, "NzbDrone.Web.MvcApplication");
|
|
|
|
LogConfiguration.RegisterConsoleLogger(LogLevel.Info, "NzbDrone.Core.CentralDispatch");
|
2012-03-06 18:59:43 -08:00
|
|
|
LogConfiguration.RegisterRollingFileLogger(environmentProvider.GetLogFileName(), LogLevel.Trace);
|
2012-01-22 18:24:16 -08:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|