aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Startup.Common/UnhandledExceptionWriter.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-11-11 00:41:05 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-11-11 00:41:05 -0500
commitb3f22fd05237e589d79e3f06de7e5db27effcc93 (patch)
tree46e5213297a976736ea890ade049a69094a8e6c3 /MediaBrowser.Server.Startup.Common/UnhandledExceptionWriter.cs
parent2a5cc34256055605465f9488913fe08cf074656d (diff)
update server core project
Diffstat (limited to 'MediaBrowser.Server.Startup.Common/UnhandledExceptionWriter.cs')
-rw-r--r--MediaBrowser.Server.Startup.Common/UnhandledExceptionWriter.cs38
1 files changed, 0 insertions, 38 deletions
diff --git a/MediaBrowser.Server.Startup.Common/UnhandledExceptionWriter.cs b/MediaBrowser.Server.Startup.Common/UnhandledExceptionWriter.cs
deleted file mode 100644
index 696c3892e..000000000
--- a/MediaBrowser.Server.Startup.Common/UnhandledExceptionWriter.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-using MediaBrowser.Common.Configuration;
-using MediaBrowser.Model.Logging;
-using System;
-using System.IO;
-
-namespace MediaBrowser.Server.Startup.Common
-{
- public class UnhandledExceptionWriter
- {
- private readonly IApplicationPaths _appPaths;
- private readonly ILogger _logger;
- private readonly ILogManager _logManager;
-
- public UnhandledExceptionWriter(IApplicationPaths appPaths, ILogger logger, ILogManager logManager)
- {
- _appPaths = appPaths;
- _logger = logger;
- _logManager = logManager;
- }
-
- public void Log(Exception ex)
- {
- _logger.ErrorException("UnhandledException", ex);
- _logManager.Flush();
-
- var path = Path.Combine(_appPaths.LogDirectoryPath, "unhandled_" + Guid.NewGuid() + ".txt");
- Directory.CreateDirectory(Path.GetDirectoryName(path));
-
- var builder = LogHelper.GetLogMessage(ex);
-
- // Write to console just in case file logging fails
- Console.WriteLine("UnhandledException");
- Console.WriteLine(builder.ToString());
-
- File.WriteAllText(path, builder.ToString());
- }
- }
-}