File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66using System . Web . Routing ;
77using $safeprojectname $. App_Start ;
88using $safeprojectname $. Controllers ;
9+ using NLog ;
910
1011namespace $safeprojectname $
1112{
1213 public class MvcApplication : HttpApplication
1314 {
15+ private static readonly Logger Log = LogManager . GetCurrentClassLogger ( ) ;
16+
1417 protected void Application_Start ( )
1518 {
19+ Log . Info ( "Starting up..." ) ;
1620 AreaRegistration . RegisterAllAreas ( ) ;
1721 RouteConfig . RegisterRoutes ( RouteTable . Routes ) ;
1822 BundleConfig . RegisterBundles ( BundleTable . Bundles ) ;
23+
24+ Log . Info ( "Routes and bundles registered" ) ;
25+ Log . Info ( "Started" ) ;
26+ }
27+
28+ protected void Application_End ( )
29+ {
30+ Log . Info ( "Stopped" ) ;
1931 }
2032
2133 protected void Application_Error ( object sender , EventArgs e )
2234 {
2335 var exception = Server . GetLastError ( ) ;
36+ Log . Error ( exception , "Unhandled application exception" ) ;
37+
2438 var httpContext = ( ( HttpApplication ) sender ) . Context ;
2539 httpContext . Response . Clear ( ) ;
2640 httpContext . ClearError ( ) ;
You can’t perform that action at this time.
0 commit comments