blob: 3ae68e2858201a3f2636f82a28fca82a267e5133 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
//-----------------------------------------------------------------------
// <copyright file="Global.asax.cs" company="Outercurve Foundation">
// Copyright (c) Outercurve Foundation. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace WebFormsRelyingParty {
using System;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.ServiceModel;
using System.Web;
public class Global : System.Web.HttpApplication {
/// <summary>
/// The logger for this web site to use.
/// </summary>
private static log4net.ILog logger = log4net.LogManager.GetLogger("WebFormsRelyingParty");
public static log4net.ILog Logger {
get { return logger; }
}
protected void Application_Start(object sender, EventArgs e) {
log4net.Config.XmlConfigurator.Configure();
Logger.Info("Web application starting...");
}
protected void Session_Start(object sender, EventArgs e) {
}
protected void Application_BeginRequest(object sender, EventArgs e) {
}
protected void Application_EndRequest(object sender, EventArgs e) {
}
protected void Application_AuthenticateRequest(object sender, EventArgs e) {
}
protected void Application_Error(object sender, EventArgs e) {
Logger.Error("An unhandled exception occurred in ASP.NET processing for page " + HttpContext.Current.Request.Path, Server.GetLastError());
}
protected void Session_End(object sender, EventArgs e) {
}
protected void Application_End(object sender, EventArgs e) {
Logger.Info("Web application shutting down...");
// this would be automatic, but in partial trust scenarios it is not.
log4net.LogManager.Shutdown();
}
}
}
|