summaryrefslogtreecommitdiffstats
path: root/samples/OAuthServiceProvider
diff options
context:
space:
mode:
Diffstat (limited to 'samples/OAuthServiceProvider')
-rw-r--r--samples/OAuthServiceProvider/Code/Global.cs10
-rw-r--r--samples/OAuthServiceProvider/Code/OAuthAuthorizationManager.cs3
-rw-r--r--samples/OAuthServiceProvider/Code/TracePageAppender.cs13
-rw-r--r--samples/OAuthServiceProvider/OAuthServiceProvider.csproj5
-rw-r--r--samples/OAuthServiceProvider/packages.config1
5 files changed, 6 insertions, 26 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
diff --git a/samples/OAuthServiceProvider/OAuthServiceProvider.csproj b/samples/OAuthServiceProvider/OAuthServiceProvider.csproj
index 1c5b7da..b677fdc 100644
--- a/samples/OAuthServiceProvider/OAuthServiceProvider.csproj
+++ b/samples/OAuthServiceProvider/OAuthServiceProvider.csproj
@@ -46,10 +46,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="log4net, Version=1.2.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\src\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
- </Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Data.DataSetExtensions" />
@@ -115,7 +111,6 @@
<Compile Include="Code\OAuthToken.cs" />
<Compile Include="Code\RequestScopedTokenMessage.cs" />
<Compile Include="Code\TokenAuthorizationState.cs" />
- <Compile Include="Code\TracePageAppender.cs" />
<Compile Include="Code\Utilities.cs" />
<Compile Include="Code\DataClasses.designer.cs">
<AutoGen>True</AutoGen>
diff --git a/samples/OAuthServiceProvider/packages.config b/samples/OAuthServiceProvider/packages.config
index ea83ad2..c6cfe98 100644
--- a/samples/OAuthServiceProvider/packages.config
+++ b/samples/OAuthServiceProvider/packages.config
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="log4net" version="2.0.2" targetFramework="net45" />
<package id="Microsoft.Bcl" version="1.1.3" targetFramework="net45" />
<package id="Microsoft.Bcl.Build" version="1.0.10" targetFramework="net45" />
<package id="Microsoft.Net.Http" version="2.2.15" targetFramework="net45" />