diff --git a/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs b/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs index 477f35641..0e9f7c85b 100644 --- a/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs +++ b/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs @@ -47,6 +47,7 @@ namespace NzbDrone.Core.Configuration string UpdateScriptPath { get; } string SyslogServer { get; } int SyslogPort { get; } + string SyslogLevel { get; } } public class ConfigFileProvider : IConfigFileProvider @@ -216,6 +217,8 @@ namespace NzbDrone.Core.Configuration public int SyslogPort => GetValueInt("SyslogPort", 514, persist: false); + public string SyslogLevel => GetValue("SyslogLevel", LogLevel, false).ToLowerInvariant(); + public int GetValueInt(string key, int defaultValue, bool persist = true) { return Convert.ToInt32(GetValue(key, defaultValue, persist)); diff --git a/src/NzbDrone.Core/Instrumentation/ReconfigureLogging.cs b/src/NzbDrone.Core/Instrumentation/ReconfigureLogging.cs index 6e13f3811..ee7d2f072 100644 --- a/src/NzbDrone.Core/Instrumentation/ReconfigureLogging.cs +++ b/src/NzbDrone.Core/Instrumentation/ReconfigureLogging.cs @@ -44,7 +44,8 @@ namespace NzbDrone.Core.Instrumentation if (_configFileProvider.SyslogServer.IsNotNullOrWhiteSpace()) { - SetSyslogParameters(_configFileProvider.SyslogServer, _configFileProvider.SyslogPort, minimumLogLevel); + var syslogLevel = LogLevel.FromString(_configFileProvider.SyslogLevel); + SetSyslogParameters(_configFileProvider.SyslogServer, _configFileProvider.SyslogPort, syslogLevel); } var rules = LogManager.Configuration.LoggingRules; @@ -118,7 +119,7 @@ namespace NzbDrone.Core.Instrumentation syslogTarget.MessageSend.Udp.Server = syslogServer; syslogTarget.MessageSend.Udp.ReconnectInterval = 500; syslogTarget.MessageCreation.Rfc = RfcNumber.Rfc5424; - syslogTarget.MessageCreation.Rfc5424.AppName = BuildInfo.AppName; + syslogTarget.MessageCreation.Rfc5424.AppName = _configFileProvider.InstanceName; var loggingRule = new LoggingRule("*", minimumLogLevel, syslogTarget);