Note : This post is first published on Dec-2010 in my previous blog Techkindle. Moving the content here.


It is an important component of the development cycle. It is the process of recording information with automated program. It is used to understand the activity of the application & to diagnose problems.


  • It provides precise context about the execution of the application.
  • Once inserted into the code, the generation of logging output requires no human intervention.
  • Log output can be saved in persistent medium to be studied at a later time.


Its an open source library that allows .NET applications to output log statements to a variety of output targets such as to a file,the console, the database or even e.mail.
It allows the developer to control which log statements are output with arbitrary granularity. It is fully configurable at run time using external configuration files.


  • log4net is optimized for speed.
  • log4net is based on a named logger hierarchy.
  • log4net is fail-stop but not reliable.
  • log4net is thread-safe.
  • log4net is not restricted to a predefined set of facilities.
  • Logging behavior can be set at run time using a configuration file. Configuration files are in XML format.
  • log4net is designed to handle exceptions from the start.
  • log4net categorizes logging into levels: DEBUG, INFO, WARN, ERROR and FATAL.
  • The format of the log output can be easily changed by implementing a new layout class.
  • The target of the log output as well as the writing strategy can be altered by writing a new appender class.
  • log4net supports multiple output appenders per logger.

Log4net can be downloaded from here. Log4net Download

Log4net is from the The Apache Software Foundation
Note:It can slow down the application.

Other Logging frameworks are