aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Mono
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Mono')
-rw-r--r--MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj3
-rw-r--r--MediaBrowser.Server.Mono/Program.cs15
2 files changed, 17 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj b/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj
index de3d2d0cb..2c99f3370 100644
--- a/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj
+++ b/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj
@@ -135,5 +135,8 @@
<None Include="tray.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
+ <None Include="sqlite3.dll">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
</ItemGroup>
</Project> \ No newline at end of file
diff --git a/MediaBrowser.Server.Mono/Program.cs b/MediaBrowser.Server.Mono/Program.cs
index 2c2390a81..ea6cca6ff 100644
--- a/MediaBrowser.Server.Mono/Program.cs
+++ b/MediaBrowser.Server.Mono/Program.cs
@@ -206,7 +206,7 @@ namespace MediaBrowser.Server.Mono
{
var exception = (Exception)e.ExceptionObject;
- _logger.ErrorException("UnhandledException", exception);
+ LogUnhandledException(exception);
if (!Debugger.IsAttached)
{
@@ -214,6 +214,19 @@ 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);
+
+ File.WriteAllText(path, builder.ToString());
+ }
+
/// <summary>
/// Performs the update if needed.
/// </summary>