Elias, thanks for your response. > It's a nice idea, but there's some code formatting and initialization > things to clean up. Also, there's some potential performance issues...
what "initialization things" do you mean? I know that initialization
(things I'm doing in initAppenders()) should be done in activateOptions()
but I noticed that I can't get the decorated appenders in
activateOptions(). :-((
I don't love to call initAppenders() every time doAppend() is called but I
found no other way. Give me a hint for any other solution.
>
> Just as an example:
>
> protected void appendInternalMessage( Object msg, long timestamp
)
> {
> if( msg != null && msg.toString().trim().length() > 0 )
> {
> // use message as pattern
> PatternLayout layout = new PatternLayout(
msg.toString() );
>
> Calling msg.toString() and creating a new PatternLayout per message
> seems a little costly. It's also wrong (like, what if %C appeared in
You're right. I've changed that.
> your message?)
Don't see the issue if %C appears in the message. It should be possible to
use all the special characters of the PatternLayout in header and footer
lines (and they should be replaced). Using %C you're able to create a
header line like "Dumping cached events because of message initiated by
%C".
Do you think there's a chance to add the appender to the official log4j
stuff?
Regards,
Alex
CachingAppender.java
Description: Binary data
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
