mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
New: Register a null target for sentry logs
Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
This commit is contained in:
parent
c4fd06949b
commit
fd563b5fbf
1 changed files with 9 additions and 0 deletions
|
@ -26,6 +26,8 @@ namespace NzbDrone.Test.Common
|
||||||
var logOutput = TestLogOutput.Console;
|
var logOutput = TestLogOutput.Console;
|
||||||
Enum.TryParse<TestLogOutput>(Environment.GetEnvironmentVariable("LIDARR_TESTS_LOG_OUTPUT"), out logOutput);
|
Enum.TryParse<TestLogOutput>(Environment.GetEnvironmentVariable("LIDARR_TESTS_LOG_OUTPUT"), out logOutput);
|
||||||
|
|
||||||
|
RegisterSentryLogger();
|
||||||
|
|
||||||
switch (logOutput)
|
switch (logOutput)
|
||||||
{
|
{
|
||||||
case TestLogOutput.Console:
|
case TestLogOutput.Console:
|
||||||
|
@ -68,6 +70,13 @@ namespace NzbDrone.Test.Common
|
||||||
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Trace, fileTarget));
|
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Trace, fileTarget));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void RegisterSentryLogger()
|
||||||
|
{
|
||||||
|
// Register a null target for sentry logs, so they aren't caught by other loggers.
|
||||||
|
var loggingRuleSentry = new LoggingRule("Sentry", LogLevel.Debug, new NullTarget()) { Final = true };
|
||||||
|
LogManager.Configuration.LoggingRules.Insert(0, loggingRuleSentry);
|
||||||
|
}
|
||||||
|
|
||||||
private static void RegisterExceptionVerification()
|
private static void RegisterExceptionVerification()
|
||||||
{
|
{
|
||||||
var exceptionVerification = new ExceptionVerification();
|
var exceptionVerification = new ExceptionVerification();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue