aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Library/UserManager.cs
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2018-12-30 17:29:02 -0500
committerGitHub <noreply@github.com>2018-12-30 17:29:02 -0500
commit1f02cf4b7e13c932bc30968cbb74b71885fd3eb7 (patch)
tree2fbf2e570340765abd40b5ad8e491f1f212699c0 /Emby.Server.Implementations/Library/UserManager.cs
parent7ad023143062c1995178e5700961b553822bd5af (diff)
parent4c95aee52eda793d1e013164cc0fde9eb609f894 (diff)
Merge pull request #285 from Bond-009/logging
Use Serilog to handle logging
Diffstat (limited to 'Emby.Server.Implementations/Library/UserManager.cs')
-rw-r--r--Emby.Server.Implementations/Library/UserManager.cs22
1 files changed, 11 insertions, 11 deletions
diff --git a/Emby.Server.Implementations/Library/UserManager.cs b/Emby.Server.Implementations/Library/UserManager.cs
index da80a4824..ae3577b7d 100644
--- a/Emby.Server.Implementations/Library/UserManager.cs
+++ b/Emby.Server.Implementations/Library/UserManager.cs
@@ -15,7 +15,7 @@ using MediaBrowser.Model.Connect;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Events;
-using MediaBrowser.Model.Logging;
+using Microsoft.Extensions.Logging;
using MediaBrowser.Model.Serialization;
using MediaBrowser.Model.Users;
using System;
@@ -340,7 +340,7 @@ namespace Emby.Server.Implementations.Library
UpdateInvalidLoginAttemptCount(user, user.Policy.InvalidLoginAttemptCount + 1);
}
- _logger.Info("Authentication request for {0} {1}.", user.Name, success ? "has succeeded" : "has been denied");
+ _logger.LogInformation("Authentication request for {0} {1}.", user.Name, success ? "has succeeded" : "has been denied");
return success ? user : null;
}
@@ -392,7 +392,7 @@ namespace Emby.Server.Implementations.Library
}
catch (Exception ex)
{
- _logger.ErrorException("Error authenticating with provider {0}", ex, provider.Name);
+ _logger.LogError(ex, "Error authenticating with provider {provider}", provider.Name);
return false;
}
@@ -461,7 +461,7 @@ namespace Emby.Server.Implementations.Library
if (newValue >= maxCount)
{
- //_logger.Debug("Disabling user {0} due to {1} unsuccessful login attempts.", user.Name, newValue.ToString(CultureInfo.InvariantCulture));
+ //_logger.LogDebug("Disabling user {0} due to {1} unsuccessful login attempts.", user.Name, newValue.ToString(CultureInfo.InvariantCulture));
//user.Policy.IsDisabled = true;
//fireLockout = true;
@@ -575,7 +575,7 @@ namespace Emby.Server.Implementations.Library
catch (Exception ex)
{
// Have to use a catch-all unfortunately because some .net image methods throw plain Exceptions
- _logger.ErrorException("Error generating PrimaryImageAspectRatio for {0}", ex, user.Name);
+ _logger.LogError(ex, "Error generating PrimaryImageAspectRatio for {user}", user.Name);
}
}
@@ -599,7 +599,7 @@ namespace Emby.Server.Implementations.Library
}
catch (Exception ex)
{
- _logger.ErrorException("Error getting {0} image info for {1}", ex, image.Type, image.Path);
+ _logger.LogError(ex, "Error getting {imageType} image info for {imagePath}", image.Type, image.Path);
return null;
}
}
@@ -613,7 +613,7 @@ namespace Emby.Server.Implementations.Library
{
foreach (var user in Users)
{
- await user.RefreshMetadata(new MetadataRefreshOptions(_fileSystem), cancellationToken).ConfigureAwait(false);
+ await user.RefreshMetadata(new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem)), cancellationToken).ConfigureAwait(false);
}
}
@@ -775,7 +775,7 @@ namespace Emby.Server.Implementations.Library
}
catch (IOException ex)
{
- _logger.ErrorException("Error deleting file {0}", ex, configPath);
+ _logger.LogError(ex, "Error deleting file {path}", configPath);
}
DeleteUserPolicy(user);
@@ -1045,7 +1045,7 @@ namespace Emby.Server.Implementations.Library
}
catch (Exception ex)
{
- _logger.ErrorException("Error reading policy file: {0}", ex, path);
+ _logger.LogError(ex, "Error reading policy file: {path}", path);
return GetDefaultPolicy(user);
}
@@ -1109,7 +1109,7 @@ namespace Emby.Server.Implementations.Library
}
catch (Exception ex)
{
- _logger.ErrorException("Error deleting policy file", ex);
+ _logger.LogError(ex, "Error deleting policy file");
}
}
@@ -1144,7 +1144,7 @@ namespace Emby.Server.Implementations.Library
}
catch (Exception ex)
{
- _logger.ErrorException("Error reading policy file: {0}", ex, path);
+ _logger.LogError(ex, "Error reading policy file: {path}", path);
return new UserConfiguration();
}