GoldbergGUI/GoldbergGUI.WPF/Setup.cs

24 lines
738 B
C#
Raw Normal View History

using MvvmCross.Logging;
using MvvmCross.Platforms.Wpf.Core;
using Serilog;
2021-12-22 07:15:28 -05:00
using System.IO;
namespace GoldbergGUI.WPF
{
public class Setup : MvxWpfSetup<Core.App>
{
public override MvxLogProviderType GetDefaultLogProviderType() => MvxLogProviderType.Serilog;
2021-12-22 07:15:28 -05:00
protected override IMvxLogProvider CreateLogProvider()
{
2021-12-22 07:15:28 -05:00
var logPath = Path.Combine(Directory.GetCurrentDirectory(), "goldberg_.log");
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.WriteTo.Console()
.WriteTo.File(logPath, rollingInterval: RollingInterval.Day)
.CreateLogger();
return base.CreateLogProvider();
}
}
}