summaryrefslogtreecommitdiffstats
path: root/samples/RelyingPartyPortal/Global.asax.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2009-12-15 22:17:20 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2009-12-15 22:17:20 -0800
commite12782c1a6727390b2107ff2e39d4ac6173d86fc (patch)
tree3be0ccda0a9425927263f5b6b9616ef8ba11ac08 /samples/RelyingPartyPortal/Global.asax.cs
parent078b1f350eb40ceee7423c25b1d833dd1f242da4 (diff)
parenta545f7be2693596fa14540c359e43150a6a7cf88 (diff)
downloadDotNetOpenAuth-origin/mono.zip
DotNetOpenAuth-origin/mono.tar.gz
DotNetOpenAuth-origin/mono.tar.bz2
Merge branch 'v2.5' into monoorigin/mono
Conflicts: src/DotNetOpenId/Properties/AssemblyInfo.cs src/DotNetOpenId/RelyingParty/AuthenticationResponse.cs
Diffstat (limited to 'samples/RelyingPartyPortal/Global.asax.cs')
-rw-r--r--samples/RelyingPartyPortal/Global.asax.cs28
1 files changed, 19 insertions, 9 deletions
diff --git a/samples/RelyingPartyPortal/Global.asax.cs b/samples/RelyingPartyPortal/Global.asax.cs
index 56636a5..eb61da9 100644
--- a/samples/RelyingPartyPortal/Global.asax.cs
+++ b/samples/RelyingPartyPortal/Global.asax.cs
@@ -1,14 +1,24 @@
using System;
using System.Collections.Specialized;
-using System.Diagnostics;
using System.IO;
+using System.Text;
using System.Web;
namespace ConsumerPortal {
public class Global : System.Web.HttpApplication {
- public Global() {
- // since this is a sample, and will often be used with localhost
- DotNetOpenId.UntrustedWebRequest.WhitelistHosts.Add("localhost");
+ internal static StringBuilder LogMessages = new StringBuilder();
+
+ public static log4net.ILog Logger = log4net.LogManager.GetLogger(typeof(Global));
+
+ 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();
}
string stripQueryString(Uri uri) {
@@ -19,22 +29,22 @@ namespace ConsumerPortal {
protected void Application_BeginRequest(Object sender, EventArgs e) {
// System.Diagnostics.Debugger.Launch();
- Trace.TraceInformation("Processing {0} on {1} ", Request.HttpMethod, stripQueryString(Request.Url));
+ Logger.DebugFormat("Processing {0} on {1} ", Request.HttpMethod, stripQueryString(Request.Url));
if (Request.QueryString.Count > 0)
- Trace.TraceInformation("Querystring follows: \n{0}", ToString(Request.QueryString));
+ Logger.DebugFormat("Querystring follows: \n{0}", ToString(Request.QueryString));
if (Request.Form.Count > 0)
- Trace.TraceInformation("Posted form follows: \n{0}", ToString(Request.Form));
+ Logger.DebugFormat("Posted form follows: \n{0}", ToString(Request.Form));
}
protected void Application_AuthenticateRequest(Object sender, EventArgs e) {
- Trace.TraceInformation("User {0} authenticated.", HttpContext.Current.User != null ? "IS" : "is NOT");
+ 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) {
- Trace.TraceError("An unhandled exception was raised. Details follow: {0}",
+ Logger.ErrorFormat("An unhandled exception was raised. Details follow: {0}",
HttpContext.Current.Server.GetLastError());
}