move logger config to app init
This commit is contained in:
parent
a673d5bec0
commit
227e68f8fd
@ -15,6 +15,16 @@ public partial class App : Application
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
|
||||
var logPath = Path.Join(Environment.CurrentDirectory, "spt-aki-installer_.log");
|
||||
|
||||
Log.Logger = new LoggerConfiguration()
|
||||
.MinimumLevel.Debug()
|
||||
.WriteTo
|
||||
.File(path: logPath,
|
||||
restrictedToMinimumLevel: Serilog.Events.LogEventLevel.Debug,
|
||||
rollingInterval: RollingInterval.Day)
|
||||
.CreateLogger();
|
||||
|
||||
RxApp.DefaultExceptionHandler = Observer.Create<Exception>((exception) =>
|
||||
{
|
||||
Log.Error(exception, "An application exception occurred");
|
||||
|
@ -1,7 +1,6 @@
|
||||
using Avalonia;
|
||||
using Avalonia.ReactiveUI;
|
||||
using ReactiveUI;
|
||||
using Serilog;
|
||||
using Splat;
|
||||
using SPTInstaller.Controllers;
|
||||
using SPTInstaller.Helpers;
|
||||
@ -37,15 +36,6 @@ internal class Program
|
||||
ServiceHelper.Register<PreCheckBase, NetCore6PreCheck>();
|
||||
|
||||
ServiceHelper.Register<PreCheckBase, FreeSpacePreCheck>();
|
||||
var logPath = Path.Join(Environment.CurrentDirectory, "spt-aki-installer_.log");
|
||||
|
||||
Log.Logger = new LoggerConfiguration()
|
||||
.MinimumLevel.Debug()
|
||||
.WriteTo
|
||||
.File(path: logPath,
|
||||
restrictedToMinimumLevel: Serilog.Events.LogEventLevel.Debug,
|
||||
rollingInterval: RollingInterval.Day)
|
||||
.CreateLogger();
|
||||
|
||||
ServiceHelper.Register<InstallerTaskBase, InitializationTask>();
|
||||
ServiceHelper.Register<InstallerTaskBase, ReleaseCheckTask>();
|
||||
|
Loading…
x
Reference in New Issue
Block a user