diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-11-23 17:36:40 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-11-23 17:36:40 -0500 |
| commit | 1923de72bf3c502ba9b942ef6caa5f73a33f43d6 (patch) | |
| tree | 9104da63d3f657a3cd8cb7beae70ab6ab614caf9 /MediaBrowser.ServerApplication/MainStartup.cs | |
| parent | 70c5b341dbaf274ebc57743fe51b9b8e7d73d441 (diff) | |
consolidate exception logging
Diffstat (limited to 'MediaBrowser.ServerApplication/MainStartup.cs')
| -rw-r--r-- | MediaBrowser.ServerApplication/MainStartup.cs | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/MediaBrowser.ServerApplication/MainStartup.cs b/MediaBrowser.ServerApplication/MainStartup.cs index d98f3e265..8974ca8da 100644 --- a/MediaBrowser.ServerApplication/MainStartup.cs +++ b/MediaBrowser.ServerApplication/MainStartup.cs @@ -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> |
