logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <c...@qos.ch>
Subject Re: Enhanced FileAppender
Date Tue, 10 Oct 2006 21:03:19 GMT
Heri et al.,

Jumping in on this thread a little late, I believe that the decorator
pattern would offer a significant advantage because it would handle
derivatives of the FileAppender class such as RollingFileAppender. On
the down side, in order to configure the embedded file appender,
MultiFileAppender would need to somehow replay bits of configuration file
(each time a new FileAppender needs to be created). I say that replay
capability is required because in order to configure say a
RollingFileAppender whose destination is based on the user's name (for
example), one would need to configure a complete RollingFileAppender,
including possibly all its options. This can be only be done by
replaying the part of the configuration specific for the
RollingFileAppender and only configurators can do that.

Fortunately, log4j's version of JoranConfigurator can handle config replays
quite nicely whereas logback's version of JoranConfigurator cannot, at
least not today.

However, assuming that MultiFileAppender's is mainly intended for
short-term diagnosis and not as a basis for long-term logs, then the
capability to output to distinct log files based on a user-specified
logic (but without rollover capability) should meet most needs.

Do you reckon you need rollover capability along with criteria-based
log files in MultiFileAppender or would criteria-based log files
alone suffice?


At 10:03 AM 10/9/2006, Bender Heri wrote:
>Hi all
>
>After having thought during the weekend I think Patrick's suggestion of 
>Decorator Pattern would be the easiest way to go.
>
>Pro:
>- The enhancement applies to all FileAppender
>- There is no need to touch the code of the existing file appenders. They 
>work the same way as until now (except the append property is always true)

[snip]

>Heri

-- 
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch


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


Mime
View raw message