You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Sonarr/src/NzbDrone.Common/Instrumentation/InitializeLogger.cs

29 lines
698 B

using System.Linq;
using NLog;
using NLog.Fluent;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Common.Instrumentation.Extensions;
using NzbDrone.Common.Instrumentation.Sentry;
namespace NzbDrone.Common.Instrumentation
{
public class InitializeLogger
{
private readonly IOsInfo _osInfo;
public InitializeLogger(IOsInfo osInfo)
{
_osInfo = osInfo;
}
public void Initialize()
{
var sentryTarget = LogManager.Configuration.AllTargets.OfType<SentryTarget>().FirstOrDefault();
if (sentryTarget != null)
{
sentryTarget.UpdateScope(_osInfo);
}
}
}
}