mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-02 22:08:27 +01: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>
|
||||
|
||||
@@ -174,9 +174,9 @@ namespace MediaBrowser.ServerApplication
|
||||
|
||||
cmdExit.Text = _localization.GetLocalizedString("LabelExit");
|
||||
cmdCommunity.Text = _localization.GetLocalizedString("LabelVisitCommunity");
|
||||
cmdGtihub.Text = _localization.GetLocalizedString("LabelGithubWiki");
|
||||
cmdSwagger.Text = _localization.GetLocalizedString("LabelSwagger");
|
||||
cmdApiDocs.Text = _localization.GetLocalizedString("LabelViewApiDocumentation");
|
||||
cmdGtihub.Text = _localization.GetLocalizedString("LabelGithub");
|
||||
cmdSwagger.Text = _localization.GetLocalizedString("LabelApiDocumentation");
|
||||
cmdApiDocs.Text = _localization.GetLocalizedString("LabelDeveloperResources");
|
||||
cmdBrowse.Text = _localization.GetLocalizedString("LabelBrowseLibrary");
|
||||
cmdConfigure.Text = _localization.GetLocalizedString("LabelConfigureMediaBrowser");
|
||||
cmdRestart.Text = _localization.GetLocalizedString("LabelRestartServer");
|
||||
|
||||
Reference in New Issue
Block a user