title: Log4j SMTP Appender
body: <p>Hi I am a novice and the application I am currently coding for uses struts 1.2 and java. We currently use Log4j for log files but I need to implement SMTP Appender so that our errors are emailed to us.</p>
  
  <p>I've tried everything to get errors to be emailed with no luck. Below is our log4j.properties file.</p>
  
  <p>Any suggestions?</p>
  
  <p>Thanks!</p>
  
  <pre><code>log4j.rootLogger= INFO, stdout, logfile, mail
  
  log4j.appender.stdout=org.apache.log4j.ConsoleAppender
  log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
  log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - &lt;%m&gt;%n
  
  # Keep three backup files
  log4j.appender.logfile.MaxBackupIndex=3
  log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
  log4j.appender.logfile.layout.ConversionPattern=%d %p [%c] - &lt;%m&gt;%n
  log4j.appender.logfile=org.apache.log4j.RollingFileAppender
  log4j.appender.logfile.File=C:/LOGS/WIRE.log
  log4j.appender.logfile.MaxFileSize=2048KB
  
  #email appender
  log4j.appender.mail=org.apache.log4j.net.SMTPAppender
  log4j.appender.mail.BufferSize=1
  log4j.appender.mail.SMTPHost=smtp.serverhere.com
  log4j.appender.mail.From=johndoe@serverhere.com
  log4j.appender.mail.To=johndoe@serverhere.com
  log4j.appender.mail.Subject=Application Error
  log4j.appender.mail.threshold=error
  log4j.appender.mail.layout=org.apache.log4j.PatternLayout
  log4j.appender.mail.layout.ConversionPattern=%d %p [%c] - &lt;%m&gt;%n
  
  
  # Hibernates use of the org.apache classes spews out stuff like mad.
  log4j.logger.org.apache=INFO
  
  # Springframework is very talkative too.
  log4j.logger.org.springframework=INFO
  
  # acegisecurity 
  #log4j.logger.org.acegisecurity = INFO
  
  # Quartz trigger checking 
  log4j.logger.org.quartz.impl.jdbcjobstore=INFO
  #log4j.logger.org.springframework.scheduling.quartz=INFO
  </code></pre>