diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-10-13 17:22:25 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-10-13 17:22:25 -0400 |
| commit | 3d3876c9a94b86e25b6d663d65285e220fc93bcc (patch) | |
| tree | 578ce5e8a146bc842d285e3612024d6ee8ed67dd /MediaBrowser.ServerApplication/MainStartup.cs | |
| parent | 645a41b193a958672a33208b0768cc1d25a4d852 (diff) | |
better crash logging
Diffstat (limited to 'MediaBrowser.ServerApplication/MainStartup.cs')
| -rw-r--r-- | MediaBrowser.ServerApplication/MainStartup.cs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/MediaBrowser.ServerApplication/MainStartup.cs b/MediaBrowser.ServerApplication/MainStartup.cs index f61b0f1d1..c6bd65750 100644 --- a/MediaBrowser.ServerApplication/MainStartup.cs +++ b/MediaBrowser.ServerApplication/MainStartup.cs @@ -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> |
