Use Serilog in EntityFramework Core logging.

This commit is contained in:
2025-07-24 21:23:53 +01:00
parent 1435aa10ee
commit bf19439e49
15 changed files with 69 additions and 36 deletions

View File

@@ -40,6 +40,8 @@ using RomRepoMgr.Core.Workers;
using RomRepoMgr.Database;
using RomRepoMgr.Resources;
using RomRepoMgr.Views;
using Serilog;
using Serilog.Extensions.Logging;
using ErrorEventArgs = RomRepoMgr.Core.EventArgs.ErrorEventArgs;
namespace RomRepoMgr.ViewModels;
@@ -227,7 +229,7 @@ public sealed partial class SettingsViewModel : ViewModelBase
{
try
{
var ctx = Context.Create(result);
var ctx = Context.Create(result, new SerilogLoggerFactory(Log.Logger));
await ctx.Database.MigrateAsync();
}
catch
@@ -295,7 +297,7 @@ public sealed partial class SettingsViewModel : ViewModelBase
try
{
var ctx = Context.Create(result);
var ctx = Context.Create(result, new SerilogLoggerFactory(Log.Logger));
await ctx.Database.MigrateAsync();
}
catch