Is it possible to set different Pattern Layouts for different levels and thus to save messages to one logfile in a different format?
If yes does anyone know how to configure the log4j.properties ?
thx & EOF
Bost
======================================================================== An example:
the logfile in format:
<Method_M>
<DEBUG text="variable c is null"></DEBUG>
</Method_M>
<Method_N>
<DEBUG text="variable d is XXX"></DEBUG>
</Method_N>is produced by code:
public void Method_M(String c)
{
logger.info("Method_M"); // Method_M: Starting ...
logger.debug("variable c is: " + c);// ... execute Method_M
logger.info("/Method_M"); // Method_M: Done
return;
}
public void Method_N(String d)
{
logger.info("Method_N"); // Method_N: Starting ...
logger.debug("variable d is " + d);// ... execute Method_N
logger.info("/Method_N"); // Method_N: Done
return;
}so for INFO level i want to use ConversionPattern=<%m>%n
and for DEBUG level i want to use
ConversionPattern=<%p text="%m"><%p>%n
Such pseudo XML format allows me to view the logfile in a XML viewer as a tree so i can collapse uninteresting parts of logfile
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
