From 1923de72bf3c502ba9b942ef6caa5f73a33f43d6 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 23 Nov 2014 17:36:40 -0500 Subject: consolidate exception logging --- MediaBrowser.Server.Mono/Program.cs | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'MediaBrowser.Server.Mono/Program.cs') diff --git a/MediaBrowser.Server.Mono/Program.cs b/MediaBrowser.Server.Mono/Program.cs index 8a34488c62..2fb9838508 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); -- cgit v1.2.3