diff options
Diffstat (limited to 'Emby.Server.Implementations/Security')
| -rw-r--r-- | Emby.Server.Implementations/Security/AuthenticationRepository.cs | 4 | ||||
| -rw-r--r-- | Emby.Server.Implementations/Security/PluginSecurityManager.cs | 19 |
2 files changed, 10 insertions, 13 deletions
diff --git a/Emby.Server.Implementations/Security/AuthenticationRepository.cs b/Emby.Server.Implementations/Security/AuthenticationRepository.cs index f75eb6364..228d511ce 100644 --- a/Emby.Server.Implementations/Security/AuthenticationRepository.cs +++ b/Emby.Server.Implementations/Security/AuthenticationRepository.cs @@ -7,7 +7,7 @@ using System.Threading; using Emby.Server.Implementations.Data; using MediaBrowser.Controller; using MediaBrowser.Controller.Security; -using MediaBrowser.Model.Logging; +using Microsoft.Extensions.Logging; using MediaBrowser.Model.Querying; using SQLitePCL.pretty; using MediaBrowser.Model.Extensions; @@ -83,7 +83,7 @@ namespace Emby.Server.Implementations.Security } catch (Exception ex) { - Logger.ErrorException("Error migrating authentication database", ex); + Logger.LogError(ex, "Error migrating authentication database"); } } diff --git a/Emby.Server.Implementations/Security/PluginSecurityManager.cs b/Emby.Server.Implementations/Security/PluginSecurityManager.cs index 8d8d6700e..2b1494c39 100644 --- a/Emby.Server.Implementations/Security/PluginSecurityManager.cs +++ b/Emby.Server.Implementations/Security/PluginSecurityManager.cs @@ -12,7 +12,7 @@ using MediaBrowser.Controller; using MediaBrowser.Model.Cryptography; using MediaBrowser.Model.Entities; using MediaBrowser.Model.IO; -using MediaBrowser.Model.Logging; +using Microsoft.Extensions.Logging; using MediaBrowser.Model.Net; using MediaBrowser.Model.Serialization; @@ -51,7 +51,7 @@ namespace Emby.Server.Implementations.Security /// Initializes a new instance of the <see cref="PluginSecurityManager" /> class. /// </summary> public PluginSecurityManager(IServerApplicationHost appHost, IHttpClient httpClient, IJsonSerializer jsonSerializer, - IApplicationPaths appPaths, ILogManager logManager, IFileSystem fileSystem, ICryptoProvider cryptographyProvider) + IApplicationPaths appPaths, ILoggerFactory loggerFactory, IFileSystem fileSystem, ICryptoProvider cryptographyProvider) { if (httpClient == null) { @@ -64,7 +64,7 @@ namespace Emby.Server.Implementations.Security _appPaths = appPaths; _fileSystem = fileSystem; _cryptographyProvider = cryptographyProvider; - _logger = logManager.GetLogger("SecurityManager"); + _logger = loggerFactory.CreateLogger("SecurityManager"); } /// <summary> @@ -135,7 +135,7 @@ namespace Emby.Server.Implementations.Security if (reg == null) { var msg = "Result from appstore registration was null."; - _logger.Error(msg); + _logger.LogError(msg); throw new ArgumentException(msg); } if (!String.IsNullOrEmpty(reg.key)) @@ -150,18 +150,15 @@ namespace Emby.Server.Implementations.Security SaveAppStoreInfo(parameters); throw; } - catch (HttpException e) + catch (HttpException ex) { - _logger.ErrorException("Error registering appstore purchase {0}", e, parameters ?? "NO PARMS SENT"); + _logger.LogError(ex, "Error registering appstore purchase {parameters}", parameters ?? "NO PARMS SENT"); - if (e.StatusCode.HasValue && e.StatusCode.Value == HttpStatusCode.PaymentRequired) - { - } throw new Exception("Error registering store sale"); } - catch (Exception e) + catch (Exception ex) { - _logger.ErrorException("Error registering appstore purchase {0}", e, parameters ?? "NO PARMS SENT"); + _logger.LogError(ex, "Error registering appstore purchase {parameters}", parameters ?? "NO PARMS SENT"); SaveAppStoreInfo(parameters); //TODO - could create a re-try routine on start-up if this file is there. For now we can handle manually. throw new Exception("Error registering store sale"); |
