logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raylivia <rayli...@shaw.ca>
Subject How to ues log4j to send log email in the multithreaded processes as similiar with single-threaded
Date Fri, 13 Mar 2009 16:50:24 GMT

My current system is single-threaded with several modules which are
processed in sequence. I use SMTPAppender to capture error and send warning
emails with the following format:
[time][thread-1][module 1]start: XXXXXXX
[time][thread-1][module 2]XXXXXXX
[time][thread-1][module 3]XXXXXXX
[time][thread-1][module 4]ERR: XXXXXXX

After I change the system to multhithreaded, the logs will be tangled up
[time][thread-1][module 1]start: XXXXXXX
[time][thread-2][module 1]start: XXXXXXX
[time][thread-1][module 2]XXXXXXX
[time][thread-1][module 3]XXXXXXX
[time][thread-2][module 2]XXXXXXX
[time][thread-2][module 3]XXXXXXX
[time][thread-2][module 4]end: XXXXXXX
[time][thread-1][module 4]ERR: XXXXXXX

Moreover, if the buffer size in SMTPAppender is set as small, some reference
info about thread-1 will be filtered. Is there any way to format the log
email in the multhithreaded processes as similiar with single-threaded?
Customize the SMTPAppender? Or create Logger per thread?
View this message in context: http://www.nabble.com/How-to-ues-log4j-to-send-log-email-in-the-multithreaded-processes-as-similiar-with-single-threaded-tp22500546p22500546.html
Sent from the Log4j - Users mailing list archive at Nabble.com.

To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org

View raw message