From 8439b8b2abc37492f0ccc4bffb51c2f74fea2a6b Mon Sep 17 00:00:00 2001 From: glax Date: Fri, 5 Sep 2025 15:31:06 +0200 Subject: [PATCH] Configure log4net loggers --- API/Log4Net.config.xml | 23 +++++++++++++++++++++++ API/Program.cs | 2 +- API/Tranga.cs | 4 ++-- 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 API/Log4Net.config.xml diff --git a/API/Log4Net.config.xml b/API/Log4Net.config.xml new file mode 100644 index 0000000..c19ffd7 --- /dev/null +++ b/API/Log4Net.config.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/API/Program.cs b/API/Program.cs index 5004004..b631606 100644 --- a/API/Program.cs +++ b/API/Program.cs @@ -135,7 +135,7 @@ using (IServiceScope scope = app.Services.CreateScope()) } Tranga.SetServiceProvider(app.Services); -Tranga.StartLogger(); +Tranga.StartLogger(new FileInfo("Log4Net.config.xml")); Tranga.AddDefaultWorkers(); app.UseCors("AllowAll"); diff --git a/API/Tranga.cs b/API/Tranga.cs index 9869582..a5cf3d8 100644 --- a/API/Tranga.cs +++ b/API/Tranga.cs @@ -41,9 +41,9 @@ public static class Tranga internal static readonly RemoveOldNotificationsWorker RemoveOldNotificationsWorker = new(); internal static readonly UpdateCoversWorker UpdateCoversWorker = new(); - internal static void StartLogger() + internal static void StartLogger(FileInfo loggerConfigFile) { - BasicConfigurator.Configure(); + XmlConfigurator.ConfigureAndWatch(loggerConfigFile); Log.Info("Logger Configured."); Log.Info(TRANGA); }