I need to use FileAppender to log a program's messages to a single file.

During execution of the program, I would like to change the
ConversionPattern
for the PatternLayout standard layout, so that the logged messages format
changes. 

I would like to know if this can be done and how?


My understanding from the FAQ in the "Complete log4j Manual" is
that multiple appenders running in the same JVM cannot log to the same file.

So, that makes me think that I cannot define in my config file different
FileWriter appenders that have
different ConversionPatterns for PaternLayout layout and then create
diferent
loggers in the different places of my program where I want to switch the
Conversion Pattern for
the data going to this log file.

Can I somehow programatically, during execution, either:

- change/re-define the Conversion Pattern on the  PatternLayout for  an
existing appender?

or

- change/switch the layout for an exiting layout of the appender, in order
to redefine the ConversionPattern
for that PatternLayout

or

can I somehow create a new appender with the same name but different layout
so that the
program continues to use just one appender to the same file??

Any ideas would be appreciated.

Jim 






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to