[logback-user] decorating an Appender with additional behavior ?

Ceki Gülcü ceki at qos.ch
Tue Feb 22 14:04:23 CET 2011


Hello Andreas,

It really depends in the additional behaviour you have in mind. It is 
possible to add filters to an appender. An appender can also wrap 
another appender to "decorate" it with additional behavior.

Note that the cyclic buffer is an intrinsic feature of SMTPAppender. I 
don't think you could transpose cyclic buffering to other appenders. You 
could bu the result would not necessarily make sense.

HTH,

On 16/02/2011 11:49 AM, Andreas Andreakis wrote:
> Hello,
>
> which is the preferred way to decorate an Appender with additional
> behavior ?
>
> Optimally, the new behavior should be applicable to any Appender.
>
> As an example consider the Cyclic Queue behavior of the SMPTAppender. A
> CyclicQueueAppender could implement this feature and delegate calls to a
> referenced concrete Appender, such that the feature can be utilized in
> other (non-SMTP) scenarios as well.
>
> Also (if currently possible) the Decorator should be configured
> declaratively within a configuration file.
>
> kind regards,
>
> Andreas
>


More information about the Logback-user mailing list