summaryrefslogtreecommitdiffstats
path: root/samples/OAuthServiceProvider/Code
diff options
context:
space:
mode:
authorDavid Christiansen <DavidChristiansen@users.noreply.github.com>2015-01-05 09:33:24 +0000
committerDavid Christiansen <DavidChristiansen@users.noreply.github.com>2015-01-05 09:33:24 +0000
commit3770a51d19a04be18ade75f59e0ff1687010a130 (patch)
tree240382c976672ed421d529860117e37677328f02 /samples/OAuthServiceProvider/Code
parent7574924b2b5c810b7c00328f04f506f28da3f2ec (diff)
parenta14dcb800b25d1b0477ab123b6865d90865f96f0 (diff)
downloadDotNetOpenAuth-3770a51d19a04be18ade75f59e0ff1687010a130.zip
DotNetOpenAuth-3770a51d19a04be18ade75f59e0ff1687010a130.tar.gz
DotNetOpenAuth-3770a51d19a04be18ade75f59e0ff1687010a130.tar.bz2
Merge pull request #359 from DavidChristiansen/develop
Closes #356, Closes #357, Closes #358
Diffstat (limited to 'samples/OAuthServiceProvider/Code')
-rw-r--r--samples/OAuthServiceProvider/Code/Global.cs10
-rw-r--r--samples/OAuthServiceProvider/Code/OAuthAuthorizationManager.cs3
-rw-r--r--samples/OAuthServiceProvider/Code/TracePageAppender.cs13
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