public void LogSomething() { Log4netSetup.Setup(); Log4netWrapper log = new Log4netWrapper(); try { this.Exception(); } catch (Exception ex) { log.Error("Test exception.", ex); } }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RouteConfig.IgnoreRoutes(RouteTable.Routes); RouteConfig.RegisterRoutes(RouteTable.Routes); FilterConfig.RegisterFilters(GlobalFilters.Filters); BundleConfig.RegisterBundles(BundleTable.Bundles); DependencyResolutionConfig.InitializeDependencyResolution(); Log4netSetup.Setup(Server.MapPath("~/bin/log4net.config")); AppDomain.CurrentDomain.FirstChanceException += CurrentDomain_FirstChanceException; }
protected void Application_Start() { GlobalConfiguration.Configure(ConfigureHttp); Log4netSetup.Setup(Server.MapPath("~/bin/log4net.config")); }