commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <c...@qos.ch>
Subject Re: [logging] Enterprise Common Logging... dare we say 2.0?
Date Mon, 27 Dec 2004 23:31:23 GMT

At 2004-12-16 16:51:31, Richard Sitze wrote:

 > I do not advocate a fail-on-no-config or fail-on-ambiguous-config.
 >
 > I advocate a *warn* or *error* on either, using the simple default logger.
 > The warning will be visible on the console, which suffices for my
 > immediate concerns.  How that warning/error (in general) is managed is up
 > to the application environment.

Log4j 1.3 can use itself for its own logging. So, when appender A
fails, it can report errors using appender B. Appender B could alert the
system admin if that is the desired behavior.

The same goes for configuration errors which are also accessible
programmatically. For example,


   Configurator c = new SomeLog4jConfigurator();
   c.configure("some file");
   List el = c.getErrorList();
   if(el.size > 0) {
     if(analyzeErrors(el)) {
       // errors during logging configuration
       throw new IllegalStateException("Can't proceed withour logging");
     }
   }

   boolean analyzeErrors(List el) {
     // custom analysis of the errors go here
     return true/false;
   }

It seems to me that log4j already fulfills Richard's requirements wrt
logging errors and logging configuration.


-- 
Ceki Gülcü

   The complete log4j manual: http://www.qos.ch/log4j/



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message