Using Log4net in your web apps
Log4net is part of the Apache Logging Services Project. It’s a tool to help ASP.net developers log message to a text file, xml file, email or database.
- Add
log4net.Config.XmlConfigurator.Configure();to Global.asax in theApplication_Startmethod. - In your code-behind or BasePage.cs, declare
protected static readonly ILog logger =
log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - Web.config has all the magic.
, , and
To be continued…
Very helpful.