mirror of
https://github.com/Radarr/Radarr.git
synced 2024-10-06 08:07:20 +02:00
Catch errors when failing to write logs to database
This commit is contained in:
parent
571da94629
commit
d8f55c0358
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using NLog.Common;
|
||||
using NLog.Config;
|
||||
using NLog;
|
||||
using NLog.Layouts;
|
||||
@ -76,10 +77,18 @@ protected override void Write(LogEventInfo logEvent)
|
||||
log.ExceptionType = logEvent.Exception.GetType().ToString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
log.Level = logEvent.Level.Name;
|
||||
|
||||
_repository.Insert(log);
|
||||
try
|
||||
{
|
||||
_repository.Insert(log);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
InternalLogger.Error("Unable to save log event to database: {0}", ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public void Handle(ApplicationShutdownRequested message)
|
||||
|
Loading…
Reference in New Issue
Block a user