Created
June 20, 2012 23:15
-
-
Save leighghunt/2962847 to your computer and use it in GitHub Desktop.
C#: logging log4net log4NetConfigFile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add reference to System.Configuration | |
using System.Configuration; | |
private void Application_Startup(object sender, StartupEventArgs e) | |
{ | |
log4net.Config.XmlConfigurator.ConfigureAndWatch(new System.IO.FileInfo(System.Configuration.ConfigurationManager.AppSettings["log4NetConfigFile"])); | |
log4net.LogManager.GetLogger(typeof(App)).InfoFormat("Application_Startup()"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment