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.Server.Mono/Program.cs | |
| parent | 70c5b341dbaf274ebc57743fe51b9b8e7d73d441 (diff) | |
consolidate exception logging
Diffstat (limited to 'MediaBrowser.Server.Mono/Program.cs')
| -rw-r--r-- | MediaBrowser.Server.Mono/Program.cs | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/MediaBrowser.Server.Mono/Program.cs b/MediaBrowser.Server.Mono/Program.cs index 8a34488c6..2fb983850 100644 --- a/MediaBrowser.Server.Mono/Program.cs +++ b/MediaBrowser.Server.Mono/Program.cs @@ -7,7 +7,6 @@ using MediaBrowser.Server.Startup.Common; using Microsoft.Win32; using System; using System.Diagnostics; -using System.IO; using System.Net; using System.Net.Security; using System.Reflection; @@ -124,7 +123,7 @@ namespace MediaBrowser.Server.Mono { var exception = (Exception)e.ExceptionObject; - LogUnhandledException(exception); + new UnhandledExceptionWriter(_appHost.ServerConfigurationManager.ApplicationPaths, _logger, _appHost.LogManager).Log(exception); if (!Debugger.IsAttached) { @@ -132,22 +131,6 @@ namespace MediaBrowser.Server.Mono } } - private static void LogUnhandledException(Exception ex) - { - _logger.ErrorException("UnhandledException", ex); - - _appHost.LogManager.Flush (); - - var path = Path.Combine(_appHost.ServerConfigurationManager.ApplicationPaths.LogDirectoryPath, "crash_" + Guid.NewGuid() + ".txt"); - - var builder = LogHelper.GetLogMessage(ex); - - Console.WriteLine ("UnhandledException"); - Console.WriteLine (builder.ToString()); - - File.WriteAllText(path, builder.ToString()); - } - public static void Shutdown() { ApplicationTaskCompletionSource.SetResult (true); |
