diff --git a/src/Microsoft.AspNet.Identity/IdentityResult.cs b/src/Microsoft.AspNet.Identity/IdentityResult.cs index 043c605fef..b6b795abba 100644 --- a/src/Microsoft.AspNet.Identity/IdentityResult.cs +++ b/src/Microsoft.AspNet.Identity/IdentityResult.cs @@ -60,11 +60,11 @@ namespace Microsoft.AspNet.Identity // TODO: Take logging level as a parameter if (Succeeded) { - logger.WriteInformation(Resources.FormatLogIdentityResultSuccess(message)); + logger.LogInformation(Resources.FormatLogIdentityResultSuccess(message)); } else { - logger.WriteWarning(Resources.FormatLogIdentityResultFailure(message, string.Join(",", Errors.Select(x => x.Code).ToList()))); + logger.LogWarning(Resources.FormatLogIdentityResultFailure(message, string.Join(",", Errors.Select(x => x.Code).ToList()))); } } } diff --git a/src/Microsoft.AspNet.Identity/SignInManager.cs b/src/Microsoft.AspNet.Identity/SignInManager.cs index dd151431a0..9b61fbb588 100644 --- a/src/Microsoft.AspNet.Identity/SignInManager.cs +++ b/src/Microsoft.AspNet.Identity/SignInManager.cs @@ -411,7 +411,7 @@ namespace Microsoft.AspNet.Identity /// protected async virtual Task LogResultAsync(bool result, TUser user, [System.Runtime.CompilerServices.CallerMemberName] string methodName = "") { - Logger.WriteInformation(Resources.FormatLoggingSigninResult(Resources.FormatLoggingResultMessage(methodName, + Logger.LogInformation(Resources.FormatLoggingSigninResult(Resources.FormatLoggingResultMessage(methodName, await UserManager.GetUserIdAsync(user)), result)); return result; diff --git a/src/Microsoft.AspNet.Identity/SignInResult.cs b/src/Microsoft.AspNet.Identity/SignInResult.cs index 7ef69a60bb..3e8cf03537 100644 --- a/src/Microsoft.AspNet.Identity/SignInResult.cs +++ b/src/Microsoft.AspNet.Identity/SignInResult.cs @@ -90,23 +90,23 @@ namespace Microsoft.AspNet.Identity { if (IsLockedOut) { - logger.WriteInformation(Resources.FormatLoggingSigninResult(message, "Lockedout")); + logger.LogInformation(Resources.FormatLoggingSigninResult(message, "Lockedout")); } else if (IsNotAllowed) { - logger.WriteInformation(Resources.FormatLoggingSigninResult(message, "NotAllowed")); + logger.LogInformation(Resources.FormatLoggingSigninResult(message, "NotAllowed")); } else if (RequiresTwoFactor) { - logger.WriteInformation(Resources.FormatLoggingSigninResult(message, "RequiresTwoFactor")); + logger.LogInformation(Resources.FormatLoggingSigninResult(message, "RequiresTwoFactor")); } else if (Succeeded) { - logger.WriteInformation(Resources.FormatLoggingSigninResult(message, "Succeeded")); + logger.LogInformation(Resources.FormatLoggingSigninResult(message, "Succeeded")); } else { - logger.WriteInformation(Resources.FormatLoggingSigninResult(message, "Failed")); + logger.LogInformation(Resources.FormatLoggingSigninResult(message, "Failed")); } } } diff --git a/src/Microsoft.AspNet.Identity/UserManager.cs b/src/Microsoft.AspNet.Identity/UserManager.cs index 3bb502c2a1..04c0edc96c 100644 --- a/src/Microsoft.AspNet.Identity/UserManager.cs +++ b/src/Microsoft.AspNet.Identity/UserManager.cs @@ -1935,11 +1935,11 @@ namespace Microsoft.AspNet.Identity var baseMessage = Resources.FormatLoggingResultMessage(methodName, await GetUserIdAsync(user)); if (result) { - Logger.WriteInformation(string.Format("{0} : {1}", baseMessage, result.ToString())); + Logger.LogInformation(string.Format("{0} : {1}", baseMessage, result.ToString())); } else { - Logger.WriteWarning(string.Format("{0} : {1}", baseMessage, result.ToString())); + Logger.LogWarning(string.Format("{0} : {1}", baseMessage, result.ToString())); } return result; diff --git a/test/Shared/MockHelpers.cs b/test/Shared/MockHelpers.cs index 590c708791..ddc30e09b1 100644 --- a/test/Shared/MockHelpers.cs +++ b/test/Shared/MockHelpers.cs @@ -39,7 +39,7 @@ namespace Microsoft.AspNet.Identity.Test { logStore = logStore ?? LogMessage; var logger = new Mock>(); - logger.Setup(x => x.Write(It.IsAny(), It.IsAny(), It.IsAny(), + logger.Setup(x => x.Log(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())) .Callback((LogLevel logLevel, int eventId, object state, Exception exception, Func formatter) => { logStore.Append(state.ToString()); }); diff --git a/test/Shared/TestLogger.cs b/test/Shared/TestLogger.cs index 7cd1db5d86..6032552c4c 100644 --- a/test/Shared/TestLogger.cs +++ b/test/Shared/TestLogger.cs @@ -21,7 +21,7 @@ namespace Microsoft.AspNet.Identity.Test return true; } - public void Write(LogLevel logLevel, int eventId, object state, Exception exception, Func formatter) + public void Log(LogLevel logLevel, int eventId, object state, Exception exception, Func formatter) { LogMessages.Add(state.ToString()); } diff --git a/test/Shared/TestLoggerFactory.cs b/test/Shared/TestLoggerFactory.cs index a980eea939..0bafae7fd2 100644 --- a/test/Shared/TestLoggerFactory.cs +++ b/test/Shared/TestLoggerFactory.cs @@ -14,7 +14,7 @@ namespace Microsoft.AspNet.Identity.Test } - public ILogger Create(string name) + public ILogger CreateLogger(string name) { return new TestLogger(); }