mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-28 13:01:28 +02:00
Catch errors when failing to write logs to database
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using NLog.Common;
|
||||||
using NLog.Config;
|
using NLog.Config;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NLog.Layouts;
|
using NLog.Layouts;
|
||||||
@@ -79,8 +80,16 @@ namespace NzbDrone.Core.Instrumentation
|
|||||||
|
|
||||||
log.Level = logEvent.Level.Name;
|
log.Level = logEvent.Level.Name;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
_repository.Insert(log);
|
_repository.Insert(log);
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
InternalLogger.Error("Unable to save log event to database: {0}", ex);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void Handle(ApplicationShutdownRequested message)
|
public void Handle(ApplicationShutdownRequested message)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user