mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-17 06:23:03 +03:00
better crash logging
This commit is contained in:
@@ -398,7 +398,7 @@ namespace MediaBrowser.ServerApplication
|
||||
{
|
||||
var exception = (Exception)e.ExceptionObject;
|
||||
|
||||
_logger.ErrorException("UnhandledException", exception);
|
||||
LogUnhandledException(exception);
|
||||
|
||||
_appHost.LogManager.Flush();
|
||||
|
||||
@@ -413,6 +413,17 @@ namespace MediaBrowser.ServerApplication
|
||||
}
|
||||
}
|
||||
|
||||
private static void LogUnhandledException(Exception ex)
|
||||
{
|
||||
_logger.ErrorException("UnhandledException", ex);
|
||||
|
||||
var path = Path.Combine(_appHost.ServerConfigurationManager.ApplicationPaths.LogDirectoryPath, "crash_" + Guid.NewGuid() + ".txt");
|
||||
|
||||
var builder = LogHelper.GetLogMessage(ex);
|
||||
|
||||
File.WriteAllText(path, builder.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs the update if needed.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user