logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Schweizer Andreas <andreas.schwei...@elca.ch>
Subject RE: What log level to use?
Date Fri, 02 Sep 2005 11:51:14 GMT
Hi Peter,

> Are there any recommendations or general guidelines for when to use what
> logging level? I never know when to use log.Debug("blah") vs
> log.Info("blah") or ERROR vs FATAL for example.

the following might be helpful to you; it is an extract of the document 
describing how we use logging in the EL4NET component framework. 



A Severity Level (def) is a quality of a logging message. Assign a severity
level to every logging message that you emit from program code. Having
severity levels assigned to logging messages allows filtering out messages
that are not of interest. The following severity levels are provided:

    * FATAL: means that an exceptional context/event will lead to a process
termination. In EL4NET, errors in config and early components initialization
errors are fatal.
    * ERROR: means that an unexpected issue has occured. In EL4NET,
unexpected exceptions are logged as errors. A generic swallow (i.e. with
generic catch clause) should use this level.
    * WARN: means that some rare event occured which might be an issue but
doesn't have to. In EL4NET, a recovery mechanism makes that a lazy component
that fails to initialize and that later succeeds, leads to an exception the
first time, and a warning the second time, saying that the component is
already created but not initialized.
    * NOTICE: used for logging important state of the system. In EL4NET,
status is used to notify when all static components are loaded.
    * INFO: used for logging internal state of the system. In EL4NET, info
is used to notify when one static components is loaded. Replaces the former
STATUS level.
    * DEBUG: used for debugging/development purpose; may very rarely be used
in operational scenarioes to state the system. In EL4NET, debug is used to
display proxy generator steps.

Note: Please notice that the old TEMPORARY severity level known from
LEAF.NET is no longer supported. 

View raw message