mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-08 06:00:50 -07:00
fix saving the log level
This commit is contained in:
parent
5dc39b9b3a
commit
84edd6636d
6 changed files with 69 additions and 8 deletions
|
@ -25,7 +25,6 @@
|
|||
// ************************************************************************/
|
||||
#endregion
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Microsoft.Owin.Hosting;
|
||||
|
||||
|
@ -42,8 +41,6 @@ using PlexRequests.Store.Repository;
|
|||
using System.Diagnostics;
|
||||
|
||||
using FluentScheduler;
|
||||
|
||||
using PlexRequests.Services;
|
||||
using PlexRequests.UI.Jobs;
|
||||
|
||||
namespace PlexRequests.UI
|
||||
|
@ -91,6 +88,7 @@ namespace PlexRequests.UI
|
|||
var cn = s.SetupDb(baseUrl);
|
||||
s.CacheQualityProfiles();
|
||||
ConfigureTargets(cn);
|
||||
SetupLogging();
|
||||
|
||||
if (port == -1)
|
||||
port = GetStartupPort();
|
||||
|
@ -157,6 +155,17 @@ namespace PlexRequests.UI
|
|||
LoggingHelper.ConfigureLogging(connectionString);
|
||||
}
|
||||
|
||||
private static void SetupLogging()
|
||||
{
|
||||
var settingsService = new SettingsServiceV2<LogSettings>(new SettingsJsonRepository(new DbConfiguration(new SqliteFactory()), new MemoryCacheProvider()));
|
||||
var logSettings = settingsService.GetSettings();
|
||||
|
||||
if (logSettings != null)
|
||||
{
|
||||
LoggingHelper.ReconfigureLogLevel(LogLevel.FromOrdinal(logSettings.Level));
|
||||
}
|
||||
}
|
||||
|
||||
private static void SetupSchedulers()
|
||||
{
|
||||
TaskManager.TaskFactory = new PlexTaskFactory();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue