logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Smith" <psm...@aconex.com>
Subject MultiplexAppender & Joran
Date Mon, 18 Oct 2004 00:42:42 GMT
Hi all,

I have committed an early look at my efforts with MultiplexAppender.  Yes it
is pretty raw at this stage.

My stumbling block is currently Joran related (I think), so this might be
Ceki's domain.

My question here relates to the tests/input/multiplex/configTest-1.xml file
which is now in CVS.  It's not complete, but there for this discussion.

I started creating a Unit test first to represent the use case of a user who
wanted to create the MDC multiplexing Appender using a Time-based rolling
file appender.  I thought I would try and think like the user first, trying
to configure it, and see what implementation changes would be needed.

As you can probably see from this config file it creates the MDCKeySelector
and configures it with the MDC key of "User". It then sets the
AppenderFactory to use for this MultiplexAppender, and it is here that I am
now confused.

I started to think that I would need an AppenderFactory implementation
(TimeBasedRollingAppenderFactory in the config, doesn't exist yet, probably
won't), but maybe I don't need this, I'm not sure.   I couldn't get my mind
past the fact that the AppenderFactory only knows about the MDC value at the
point of needing to create the appender, so it's not something that can be
embedded in the configuration.

Then I started to look at the whole Rolling file name tokeniser stuff.  This
use-case requires that the User be able to configure the Time-based rolling
stuff, as well as embedding a token that represents the MDC key that needs
to be on each file.  I started thinking that I could use the %i as in:

output/MultiplexAppenderTest-%i.log.%d{yyyy.MM.dd}

to represent the value of the MDC value, but I think it's wrong, and I'm not
sure what to do, or how to solve it.

The AppenderFactory needs to take this fileNamePattern and replace a token
with the MDC Value, and then create a RollingFileAppender with the
newly-replaced pattern (it would look something like
'output/MultiplexAppenderTest-Bob.log.%d{yyyy.MM.dd}').

Anyone got any suggestions?

cheers,

Paul Smith






---------------------------------------------------------------------
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