diff options
Diffstat (limited to 'samples/OAuthResourceServer')
5 files changed, 8 insertions, 27 deletions
diff --git a/samples/OAuthResourceServer/Code/Global.cs b/samples/OAuthResourceServer/Code/Global.cs index a48baff..bf58c9c 100644 --- a/samples/OAuthResourceServer/Code/Global.cs +++ b/samples/OAuthResourceServer/Code/Global.cs @@ -5,6 +5,8 @@ using System.ServiceModel; using System.Text; using System.Web; + + using DotNetOpenAuth.Logging; using DotNetOpenAuth.OAuth2; using DotNetOpenAuth.OAuth2.Messages; @@ -39,7 +41,7 @@ /// <summary> /// The logger for this sample to use. /// </summary> - public static log4net.ILog Logger = log4net.LogManager.GetLogger("DotNetOpenAuth.OAuthResourceServer"); + public static ILog Logger = LogProvider.GetLogger("DotNetOpenAuth.OAuthResourceServer"); #if SAMPLESONLY /// <summary> @@ -85,19 +87,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()); } private void Application_EndRequest(object sender, EventArgs e) { diff --git a/samples/OAuthResourceServer/Code/OAuthAuthorizationManager.cs b/samples/OAuthResourceServer/Code/OAuthAuthorizationManager.cs index 091c9bb..37853c3 100644 --- a/samples/OAuthResourceServer/Code/OAuthAuthorizationManager.cs +++ b/samples/OAuthResourceServer/Code/OAuthAuthorizationManager.cs @@ -11,6 +11,8 @@ using System.ServiceModel.Web; using System.Threading; using System.Threading.Tasks; + + using DotNetOpenAuth.Logging; using DotNetOpenAuth.Messaging; using DotNetOpenAuth.OAuth2; using ProtocolException = System.ServiceModel.ProtocolException; @@ -57,10 +59,10 @@ return false; } } catch (ProtocolFaultResponseException ex) { - Global.Logger.Error("Error processing OAuth messages.", ex); + Global.Logger.ErrorException("Error processing OAuth messages.", ex); exception = ex; } catch (ProtocolException ex) { - Global.Logger.Error("Error processing OAuth messages.", ex); + Global.Logger.ErrorException("Error processing OAuth messages.", ex); } if (exception != null) { diff --git a/samples/OAuthResourceServer/Code/TracePageAppender.cs b/samples/OAuthResourceServer/Code/TracePageAppender.cs deleted file mode 100644 index 4dc543f..0000000 --- a/samples/OAuthResourceServer/Code/TracePageAppender.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace OAuthResourceServer.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/OAuthResourceServer/OAuthResourceServer.csproj b/samples/OAuthResourceServer/OAuthResourceServer.csproj index 2160d28..2180657 100644 --- a/samples/OAuthResourceServer/OAuthResourceServer.csproj +++ b/samples/OAuthResourceServer/OAuthResourceServer.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" /> @@ -101,7 +97,6 @@ <Compile Include="Code\IDataApi.cs" /> <Compile Include="Code\OAuthAuthorizationManager.cs" /> <Compile Include="Code\OAuthPrincipalAuthorizationPolicy.cs" /> - <Compile Include="Code\TracePageAppender.cs" /> <Compile Include="Default.aspx.cs"> <DependentUpon>Default.aspx</DependentUpon> <SubType>ASPXCodeBehind</SubType> diff --git a/samples/OAuthResourceServer/packages.config b/samples/OAuthResourceServer/packages.config index ea83ad2..c6cfe98 100644 --- a/samples/OAuthResourceServer/packages.config +++ b/samples/OAuthResourceServer/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" /> |