New: Instance Name used for Syslog

This commit is contained in:
Robin Dadswell 2022-05-12 17:10:27 +01:00 committed by Mark McDowall
parent 4a2f120bc1
commit 1558929484
1 changed files with 3 additions and 2 deletions

View File

@ -36,7 +36,8 @@ namespace NzbDrone.Core.Instrumentation
if (_configFileProvider.SyslogServer.IsNotNullOrWhiteSpace()) 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; var rules = LogManager.Configuration.LoggingRules;
@ -98,7 +99,7 @@ namespace NzbDrone.Core.Instrumentation
syslogTarget.MessageSend.Udp.Server = syslogServer; syslogTarget.MessageSend.Udp.Server = syslogServer;
syslogTarget.MessageSend.Udp.ReconnectInterval = 500; syslogTarget.MessageSend.Udp.ReconnectInterval = 500;
syslogTarget.MessageCreation.Rfc = RfcNumber.Rfc5424; syslogTarget.MessageCreation.Rfc = RfcNumber.Rfc5424;
syslogTarget.MessageCreation.Rfc5424.AppName = BuildInfo.AppName; syslogTarget.MessageCreation.Rfc5424.AppName = _configFileProvider.InstanceName;
var loggingRule = new LoggingRule("*", minimumLogLevel, syslogTarget); var loggingRule = new LoggingRule("*", minimumLogLevel, syslogTarget);