tags:

views:

41

answers:

2

Hi guys:

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

<level value="WARN" />
    <appender-ref ref="RollingLogFileAppender" />
</root>
+1  A: 

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.

Here is another good link.

Jason W
+1  A: 

I think the log4net documentation explains this quite nicely (just scroll down to Logger Hierarchy):

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).

Stefan Egli