Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > log4j SMTPAppender -- combining messages into one e-mail?

Reply
Thread Tools

log4j SMTPAppender -- combining messages into one e-mail?

 
 
Mikhail Teterin
Guest
Posts: n/a
 
      02-20-2008
Hello!

I'm trying to use log4j's SMTPAppender to get warnings and errors reported
by our application via e-mail (in addition to having ALL messages saved
into a file via RollingFileAppender).

It all works, except for one thing -- every warning/error arrives in its own
e-mail message...

The BufferSize parameters appears intended to regulate this, but no matter
what I set it to (tried different values from 1 to 102400), exactly one
log-message per e-mail are still generated...

Any ideas? Thanks!

-mi

Here is my current log4.properties file:

log4j.rootLogger=DEBUG, A1, mail
log4j.appender.A1=org.apache.log4j.RollingFileAppe nder
log4j.appender.A1.File=log.txt
log4j.appender.R.MaxFileSize=100KB
log4j.appender.R.MaxBackupIndex=1

log4j.appender.A1.layout=org.apache.log4j.PatternL ayout

# Pattern to output the caller's file name and line number.
log4j.appender.A1.layout.ConversionPattern=%d %5p [%t] (%F:%L) - %m%n

log4j.appender.mail=org.apache.log4j.net.SMTPAppen der
log4j.appender.mail.To=(E-Mail Removed)
log4j.appender.mail.From=(E-Mail Removed)
log4j.appender.mail.SMTPHost=smtp.example.com
log4j.appender.mail.Threshold=WARN
log4j.appender.mail.BufferSize=1024000
log4j.appender.mail.Subject=Testing log4j email
log4j.appender.mail.layout=org.apache.log4j.HTMLLa yout

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
log4j SMTPAppender not sending mail aflat362 Java 1 11-02-2006 04:50 PM
log4j SMTPAppender only sends ERRORs brian.dick@fmr.com Java 0 07-20-2005 09:14 PM
Using log4j with Tomcat 4.1.30 problems with log4j.properties Rodolfo Java 0 07-12-2004 08:56 AM
log4j: locating log4j.proprties in same folder as jar Alex Hunsley Java 2 05-28-2004 09:57 PM
eclipse, junit, log4j, & finding log4j.xml Alexandra Stehman Java 0 01-19-2004 03:25 PM



Advertisments