diff --git a/src/Ombi.Schedule/Jobs/Plex/PlexContentCacher.cs b/src/Ombi.Schedule/Jobs/Plex/PlexContentCacher.cs index 8cd5266a3..e07ac5ec1 100644 --- a/src/Ombi.Schedule/Jobs/Plex/PlexContentCacher.cs +++ b/src/Ombi.Schedule/Jobs/Plex/PlexContentCacher.cs @@ -68,6 +68,7 @@ namespace Ombi.Schedule.Jobs.Plex } if (!ValidateSettings(plexSettings)) { + Logger.LogError("Plex Settings are not valid"); return; } @@ -76,6 +77,8 @@ namespace Ombi.Schedule.Jobs.Plex { await StartTheCache(plexSettings); + + Logger.LogInformation("Starting EP Cacher"); BackgroundJob.Enqueue(() => EpisodeCacher.Start()); } catch (Exception e) @@ -89,6 +92,7 @@ namespace Ombi.Schedule.Jobs.Plex foreach (var servers in plexSettings.Servers ?? new List()) { + Logger.LogInformation("Getting all content from server {0}", servers.Name); var allContent = GetAllContent(servers); // Let's now process this. @@ -98,6 +102,7 @@ namespace Ombi.Schedule.Jobs.Plex if (content.viewGroup.Equals(Jobs.PlexContentCacher.PlexMediaType.Show.ToString(), StringComparison.CurrentCultureIgnoreCase)) { // Process Shows + Logger.LogInformation("Processing TV Shows"); foreach (var show in content.Metadata) { var seasonList = await PlexApi.GetSeasons(servers.PlexAuthToken, servers.FullUri, @@ -118,6 +123,7 @@ namespace Ombi.Schedule.Jobs.Plex var existingContent = await Repo.GetByKey(show.ratingKey); if (existingContent != null) { + Logger.LogInformation("We already have show {0} checking for new seasons", existingContent.Title); // Ok so we have it, let's check if there are any new seasons var itemAdded = false; foreach (var season in seasonsContent) @@ -139,6 +145,8 @@ namespace Ombi.Schedule.Jobs.Plex else { + Logger.LogInformation("New show {0}, so add it", show.title); + // Get the show metadata... This sucks since the `metadata` var contains all information about the show // But it does not contain the `guid` property that we need to pull out thetvdb id... var showMetadata = await PlexApi.GetMetadata(servers.PlexAuthToken, servers.FullUri, @@ -165,6 +173,7 @@ namespace Ombi.Schedule.Jobs.Plex } if (content.viewGroup.Equals(Jobs.PlexContentCacher.PlexMediaType.Movie.ToString(), StringComparison.CurrentCultureIgnoreCase)) { + Logger.LogInformation("Processing Movies"); foreach (var movie in content?.Metadata ?? new Metadata[]{}) { // Let's check if we have this movie @@ -174,6 +183,7 @@ namespace Ombi.Schedule.Jobs.Plex continue; } + Logger.LogInformation("Adding movie {0}", movie.title); var metaData = await PlexApi.GetMetadata(servers.PlexAuthToken, servers.FullUri, movie.ratingKey); var item = new PlexContent @@ -229,6 +239,7 @@ namespace Ombi.Schedule.Jobs.Plex .Select(x => x.Key.ToString()).ToList(); if (!keys.Contains(dir.key)) { + Logger.LogInformation("Lib {0} is not monitored, so skipping", dir.key); // We are not monitoring this lib continue; } diff --git a/src/Ombi.Schedule/Jobs/Plex/PlexEpisodeCacher.cs b/src/Ombi.Schedule/Jobs/Plex/PlexEpisodeCacher.cs index 0d777f428..74628f2e4 100644 --- a/src/Ombi.Schedule/Jobs/Plex/PlexEpisodeCacher.cs +++ b/src/Ombi.Schedule/Jobs/Plex/PlexEpisodeCacher.cs @@ -47,7 +47,6 @@ namespace Ombi.Schedule.Jobs.Plex foreach (var server in s.Servers) { - await Cache(server); BackgroundJob.Enqueue(() => _availabilityChecker.Start()); } @@ -62,6 +61,8 @@ namespace Ombi.Schedule.Jobs.Plex { if (!Validate(settings)) { + + _log.LogWarning("Validation failed"); return; } diff --git a/src/Ombi/Startup.cs b/src/Ombi/Startup.cs index b44272192..e19971d48 100644 --- a/src/Ombi/Startup.cs +++ b/src/Ombi/Startup.cs @@ -55,19 +55,19 @@ namespace Ombi if (string.IsNullOrEmpty(StoragePath.StoragePath)) { config = new LoggerConfiguration() - .MinimumLevel.Debug() + .MinimumLevel.Information() .WriteTo.RollingFile(Path.Combine(env.ContentRootPath, "Logs", "log-{Date}.txt")) - .WriteTo.SQLite("Ombi.db", "Logs", LogEventLevel.Debug) + .WriteTo.SQLite("Ombi.db", "Logs", LogEventLevel.Information) .CreateLogger(); } else { config = new LoggerConfiguration() - .MinimumLevel.Debug() + .MinimumLevel.Information() .WriteTo.RollingFile(Path.Combine(StoragePath.StoragePath, "Logs", "log-{Date}.txt")) - .WriteTo.SQLite(Path.Combine(StoragePath.StoragePath, "Ombi.db"), "Logs", LogEventLevel.Debug) + .WriteTo.SQLite(Path.Combine(StoragePath.StoragePath, "Ombi.db"), "Logs", LogEventLevel.Information) .CreateLogger(); } Log.Logger = config; diff --git a/src/Ombi/appsettings.json b/src/Ombi/appsettings.json index 9b4d941c4..16cee5778 100644 --- a/src/Ombi/appsettings.json +++ b/src/Ombi/appsettings.json @@ -2,7 +2,9 @@ "Logging": { "IncludeScopes": false, "LogLevel": { - "Default": "Warning" + "Default": "Information", + "System": "Information", + "Microsoft": "None" } }, "ApplicationSettings": {