diff options
author | David Christiansen <coding@davedoes.net> | 2016-06-06 13:53:24 +0100 |
---|---|---|
committer | David Christiansen <coding@davedoes.net> | 2016-06-06 16:10:25 +0100 |
commit | 442909c55b4b7943ad1a426072c74a0b0a4fdf95 (patch) | |
tree | 6fb18f8baa3e69bc053a8f8e63690f6ec60c6208 /src/OpenID/OpenIdProviderWebForms/Global.asax.cs | |
parent | 2ed563499ad1fbafd13d5903fb79b6bf28f0e654 (diff) | |
download | DotNetOpenAuth.Samples-442909c55b4b7943ad1a426072c74a0b0a4fdf95.zip DotNetOpenAuth.Samples-442909c55b4b7943ad1a426072c74a0b0a4fdf95.tar.gz DotNetOpenAuth.Samples-442909c55b4b7943ad1a426072c74a0b0a4fdf95.tar.bz2 |
Framework update to 4.5.2
DNOA Nuget update
Diffstat (limited to 'src/OpenID/OpenIdProviderWebForms/Global.asax.cs')
-rw-r--r-- | src/OpenID/OpenIdProviderWebForms/Global.asax.cs | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/src/OpenID/OpenIdProviderWebForms/Global.asax.cs b/src/OpenID/OpenIdProviderWebForms/Global.asax.cs deleted file mode 100644 index 43b1be6..0000000 --- a/src/OpenID/OpenIdProviderWebForms/Global.asax.cs +++ /dev/null @@ -1,70 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="Global.asax.cs" company="Outercurve Foundation"> -// Copyright (c) Outercurve Foundation. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace OpenIdProviderWebForms { - using System; - using System.Collections.Specialized; - using System.IO; - using System.Text; - using System.Web; - using OpenIdProviderWebForms.Code; - - public class Global : System.Web.HttpApplication { - public static log4net.ILog Logger = log4net.LogManager.GetLogger(typeof(Global)); - - internal static StringBuilder LogMessages = new StringBuilder(); - - public static string ToString(NameValueCollection collection) { - using (StringWriter sw = new StringWriter()) { - foreach (string key in collection.Keys) { - sw.WriteLine("{0} = '{1}'", key, collection[key]); - } - return sw.ToString(); - } - } - - protected void Application_Start(object sender, EventArgs e) { - log4net.Config.XmlConfigurator.Configure(); - Logger.Info("Sample starting..."); - } - - protected 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(); - } - - protected void Application_BeginRequest(object sender, EventArgs e) { - Logger.DebugFormat("Processing {0} on {1} ", this.Request.HttpMethod, this.stripQueryString(this.Request.Url)); - if (Request.QueryString.Count > 0) { - Logger.DebugFormat("Querystring follows: \n{0}", ToString(Request.QueryString)); - } - if (Request.Form.Count > 0) { - Logger.DebugFormat("Posted form follows: \n{0}", ToString(Request.Form)); - } - } - - protected void Application_AuthenticateRequest(object sender, EventArgs e) { - Logger.DebugFormat("User {0} authenticated.", HttpContext.Current.User != null ? "IS" : "is NOT"); - } - - protected void Application_EndRequest(object sender, EventArgs e) { - } - - protected void Application_Error(object sender, EventArgs e) { - Logger.ErrorFormat( - "An unhandled exception was raised. Details follow: {0}", - HttpContext.Current.Server.GetLastError()); - } - - private string stripQueryString(Uri uri) { - UriBuilder builder = new UriBuilder(uri); - builder.Query = null; - return builder.ToString(); - } - } -}
\ No newline at end of file |