mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Added logging on fatal crashes
Moved logs to a seperate Logs folder
This commit is contained in:
parent
7de98fd02b
commit
d0e369c653
@ -8,7 +8,7 @@ namespace Artemis.Core.Ninject
|
|||||||
private static readonly ILogger _logger = new LoggerConfiguration()
|
private static readonly ILogger _logger = new LoggerConfiguration()
|
||||||
.Enrich.FromLogContext()
|
.Enrich.FromLogContext()
|
||||||
.Enrich.WithDemystifiedStackTraces()
|
.Enrich.WithDemystifiedStackTraces()
|
||||||
.WriteTo.File("Artemis log-.txt",
|
.WriteTo.File("Logs/Artemis log-.txt",
|
||||||
rollingInterval: RollingInterval.Day,
|
rollingInterval: RollingInterval.Day,
|
||||||
outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] [{SourceContext:l}] {Message:lj}{NewLine}{Exception}")
|
outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] [{SourceContext:l}] {Message:lj}{NewLine}{Exception}")
|
||||||
.CreateLogger();
|
.CreateLogger();
|
||||||
|
|||||||
@ -94,6 +94,7 @@ namespace Artemis.Core.Services
|
|||||||
|
|
||||||
private void SurfaceOnException(ExceptionEventArgs args)
|
private void SurfaceOnException(ExceptionEventArgs args)
|
||||||
{
|
{
|
||||||
|
_logger.Warning("Surface threw e");
|
||||||
throw args.Exception;
|
throw args.Exception;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -87,6 +87,7 @@
|
|||||||
<Reference Include="MaterialDesignThemes.Wpf, Version=2.6.0.325, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="MaterialDesignThemes.Wpf, Version=2.6.0.325, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\MaterialDesignThemes.2.6.0\lib\net45\MaterialDesignThemes.Wpf.dll</HintPath>
|
<HintPath>..\packages\MaterialDesignThemes.2.6.0\lib\net45\MaterialDesignThemes.Wpf.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="Microsoft.Data.Sqlite, Version=2.2.4.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.Data.Sqlite, Version=2.2.4.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Microsoft.Data.Sqlite.Core.2.2.4\lib\netstandard2.0\Microsoft.Data.Sqlite.dll</HintPath>
|
<HintPath>..\packages\Microsoft.Data.Sqlite.Core.2.2.4\lib\netstandard2.0\Microsoft.Data.Sqlite.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
@ -110,6 +111,9 @@
|
|||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\..\RGB.NET\bin\net45\RGB.NET.Groups.dll</HintPath>
|
<HintPath>..\..\..\RGB.NET\bin\net45\RGB.NET.Groups.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="Serilog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Serilog.2.8.0\lib\net46\Serilog.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="SQLitePCLRaw.batteries_green, Version=1.1.12.351, Culture=neutral, PublicKeyToken=a84b7dcfb1391f7f, processorArchitecture=MSIL">
|
<Reference Include="SQLitePCLRaw.batteries_green, Version=1.1.12.351, Culture=neutral, PublicKeyToken=a84b7dcfb1391f7f, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\SQLitePCLRaw.bundle_green.1.1.12\lib\net45\SQLitePCLRaw.batteries_green.dll</HintPath>
|
<HintPath>..\packages\SQLitePCLRaw.bundle_green.1.1.12\lib\net45\SQLitePCLRaw.batteries_green.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
|||||||
@ -3,7 +3,6 @@ using Artemis.Core.Ninject;
|
|||||||
using Artemis.Core.Services.Interfaces;
|
using Artemis.Core.Services.Interfaces;
|
||||||
using Artemis.UI.Ninject;
|
using Artemis.UI.Ninject;
|
||||||
using Artemis.UI.Stylet;
|
using Artemis.UI.Stylet;
|
||||||
using Artemis.UI.ViewModels;
|
|
||||||
using Artemis.UI.ViewModels.Screens;
|
using Artemis.UI.ViewModels.Screens;
|
||||||
using Ninject;
|
using Ninject;
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using System.Windows.Threading;
|
||||||
using Ninject;
|
using Ninject;
|
||||||
|
using Serilog;
|
||||||
using Stylet;
|
using Stylet;
|
||||||
|
|
||||||
namespace Artemis.UI.Stylet
|
namespace Artemis.UI.Stylet
|
||||||
@ -63,5 +65,13 @@ namespace Artemis.UI.Stylet
|
|||||||
if (Kernel != null)
|
if (Kernel != null)
|
||||||
Kernel.Dispose();
|
Kernel.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnUnhandledException(DispatcherUnhandledExceptionEventArgs e)
|
||||||
|
{
|
||||||
|
var logger = Kernel.Get<ILogger>();
|
||||||
|
logger.Fatal(e.Exception, "Fatal exception, shutting down.");
|
||||||
|
|
||||||
|
base.OnUnhandledException(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -15,6 +15,7 @@
|
|||||||
<package id="Ninject.Extensions.Conventions" version="3.3.0" targetFramework="net461" />
|
<package id="Ninject.Extensions.Conventions" version="3.3.0" targetFramework="net461" />
|
||||||
<package id="Ninject.Extensions.Factory" version="3.3.2" targetFramework="net461" />
|
<package id="Ninject.Extensions.Factory" version="3.3.2" targetFramework="net461" />
|
||||||
<package id="PropertyChanged.Fody" version="3.0.1" targetFramework="net472" />
|
<package id="PropertyChanged.Fody" version="3.0.1" targetFramework="net472" />
|
||||||
|
<package id="Serilog" version="2.8.0" targetFramework="net472" />
|
||||||
<package id="SQLitePCLRaw.bundle_green" version="1.1.12" targetFramework="net472" />
|
<package id="SQLitePCLRaw.bundle_green" version="1.1.12" targetFramework="net472" />
|
||||||
<package id="SQLitePCLRaw.core" version="1.1.12" targetFramework="net472" />
|
<package id="SQLitePCLRaw.core" version="1.1.12" targetFramework="net472" />
|
||||||
<package id="SQLitePCLRaw.lib.e_sqlite3.linux" version="1.1.12" targetFramework="net472" />
|
<package id="SQLitePCLRaw.lib.e_sqlite3.linux" version="1.1.12" targetFramework="net472" />
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user