mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-27 11:14:47 +03:00
consolidate exception logging
This commit is contained in:
@@ -455,9 +455,7 @@ namespace MediaBrowser.ServerApplication
|
||||
{
|
||||
var exception = (Exception)e.ExceptionObject;
|
||||
|
||||
LogUnhandledException(exception);
|
||||
|
||||
_appHost.LogManager.Flush();
|
||||
new UnhandledExceptionWriter(_appHost.ServerConfigurationManager.ApplicationPaths, _logger, _appHost.LogManager).Log(exception);
|
||||
|
||||
if (!_isRunningAsService)
|
||||
{
|
||||
@@ -470,18 +468,6 @@ namespace MediaBrowser.ServerApplication
|
||||
}
|
||||
}
|
||||
|
||||
private static void LogUnhandledException(Exception ex)
|
||||
{
|
||||
_logger.ErrorException("UnhandledException", ex);
|
||||
|
||||
var path = Path.Combine(_appHost.ServerConfigurationManager.ApplicationPaths.LogDirectoryPath, "unhandled_" + Guid.NewGuid() + ".txt");
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(path));
|
||||
|
||||
var builder = LogHelper.GetLogMessage(ex);
|
||||
|
||||
File.WriteAllText(path, builder.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs the update if needed.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user