Hi,

 

I have the concept of a long error message and a short error message in
my application.  Long error messages get written to one file, and the
short messages get written to a different file.  Ideally in my
application everywhere that needs to log an error message can simply
call Logger.getLogger(this.getClass().getName()).error(longMessage,
shortMessage) and the configuration of log4j will send the longMessage
and shortMessage to the appropriate file.

 

I have two different appenders configured for writing to the two
different files in the appropriate format.  But I don't know how to get
the long error message written only to one of the log files, and the
short error message only written to a different log file.

 

Is there a way to configure the properties file to accomplish this?  

Or would I need to extend the behavior in log4j itself?  If so, where
would be the place to extend the behavior?

 

Thanks,

Beth

Reply via email to