Hi folks,
I have three appenders(File, SMTP1, SMTP2) attached to a single logger. I want to log messages at all levels(INFO, WARN, ERROR, FATAL) into the File appender, (WARN, ERROR AND FATAL) to the SMTP1 appender for tech support team to receive email notification. Also, i want to log FATAL message to SMTP2, which send SMS to mobiles for a group of people from support team and the management.
Obviously, due to limited length of SMS messages, i dont want to include the same amount of details as what's sent to the email and log file on the server. I want to include a summary of it in the SMS message. The question is how do i configure/code the same logger to push different messages per appender? i.e. A method like
log.fatal("SMS", "FTP server timed out!!!"); //sms message for the business
log.fatal("email", "FPT server is timed out due to blah blah...stack trace as showing below......"); //more detailed email message
i know method like this does not exist in the current log4j API, i am just wondering if anyone alway known way of archieving something like this before i have to write any customised code. Many thanks.