diff options
Diffstat (limited to 'samples/OAuthServiceProvider/Code')
-rw-r--r-- | samples/OAuthServiceProvider/Code/Global.cs | 10 | ||||
-rw-r--r-- | samples/OAuthServiceProvider/Code/OAuthAuthorizationManager.cs | 3 | ||||
-rw-r--r-- | samples/OAuthServiceProvider/Code/TracePageAppender.cs | 13 |
3 files changed, 6 insertions, 20 deletions
diff --git a/samples/OAuthServiceProvider/Code/Global.cs b/samples/OAuthServiceProvider/Code/Global.cs index 6f04a55..28db142 100644 --- a/samples/OAuthServiceProvider/Code/Global.cs +++ b/samples/OAuthServiceProvider/Code/Global.cs @@ -4,6 +4,8 @@ using System.ServiceModel; using System.Text; using System.Web; + + using DotNetOpenAuth.Logging; using DotNetOpenAuth.OAuth.Messages; /// <summary> @@ -18,7 +20,7 @@ /// <summary> /// The logger for this sample to use. /// </summary> - public static log4net.ILog Logger = log4net.LogManager.GetLogger("DotNetOpenAuth.OAuthServiceProvider"); + public static ILog Logger = LogProvider.GetLogger("DotNetOpenAuth.OAuthServiceProvider"); private readonly object syncObject = new object(); @@ -97,19 +99,15 @@ } private void Application_Start(object sender, EventArgs e) { - log4net.Config.XmlConfigurator.Configure(); Logger.Info("Sample starting..."); } private void Application_End(object sender, EventArgs e) { Logger.Info("Sample shutting down..."); - - // this would be automatic, but in partial trust scenarios it is not. - log4net.LogManager.Shutdown(); } private void Application_Error(object sender, EventArgs e) { - Logger.Error("An unhandled exception occurred in ASP.NET processing: " + Server.GetLastError(), Server.GetLastError()); + Logger.ErrorException("An unhandled exception occurred in ASP.NET processing: " + Server.GetLastError(), Server.GetLastError()); // In the event of an unhandled exception, reverse any changes that were made to the database to avoid any partial database updates. var dataContext = dataContextSimple; diff --git a/samples/OAuthServiceProvider/Code/OAuthAuthorizationManager.cs b/samples/OAuthServiceProvider/Code/OAuthAuthorizationManager.cs index 2d942b5..8f30f0c 100644 --- a/samples/OAuthServiceProvider/Code/OAuthAuthorizationManager.cs +++ b/samples/OAuthServiceProvider/Code/OAuthAuthorizationManager.cs @@ -9,6 +9,7 @@ using System.ServiceModel.Security; using System.Threading.Tasks; using DotNetOpenAuth; + using DotNetOpenAuth.Logging; using DotNetOpenAuth.OAuth; /// <summary> @@ -56,7 +57,7 @@ } } } catch (ProtocolException ex) { - Global.Logger.Error("Error processing OAuth messages.", ex); + Global.Logger.ErrorException("Error processing OAuth messages.", ex); } return false; diff --git a/samples/OAuthServiceProvider/Code/TracePageAppender.cs b/samples/OAuthServiceProvider/Code/TracePageAppender.cs deleted file mode 100644 index 8f97c89..0000000 --- a/samples/OAuthServiceProvider/Code/TracePageAppender.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace OAuthServiceProvider.Code { - using System; - using System.Collections.Generic; - using System.IO; - using System.Web; - - public class TracePageAppender : log4net.Appender.AppenderSkeleton { - protected override void Append(log4net.Core.LoggingEvent loggingEvent) { - StringWriter sw = new StringWriter(Global.LogMessages); - Layout.Format(sw, loggingEvent); - } - } -}
\ No newline at end of file |