Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the root logger in log4net

Tags:

I don't quite understand what the main functionality for root logger as shown in following section is. What is the difference from other loggers?

<root>
  <level value="WARN" />
  <appender-ref ref="RollingLogFileAppender" />
</root>
like image 468
Ricky Avatar asked Jul 26 '10 14:07

Ricky


2 Answers

I think the log4net documentation explains this quite nicely:

Loggers are organized in hierarchies. E.g.: The logger Foo.Bar is child of the logger Foo. This way the loggers create a tree and the root logger is simply the root of that tree (in the example Foo is a child of the root logger).

This hiearchy allows for some interesting configuration applications (e.g. disable/enable logging for an entire sub system of your application).

like image 175
Stefan Egli Avatar answered Sep 25 '22 10:09

Stefan Egli


The Root Logger can hold a list of appenders and settings (typically just the log level) used when logging.

Check this link for more details about the Root Logger with Log4net.

like image 32
Jason Avatar answered Sep 24 '22 10:09

Jason