I have configured log4j to write app logs using the RepositorySelector found in 
the Wiki here, and it is working just fine. I have tried to add an email 
appender to the configuration to email me the error & fatal messages and they 
are not getting sent. The log file contains the errors, but no email is ever 
generated (I checked the mail server logs, and nothing is ever being received).

My configuration is as follows:

  | <?xml version="1.0" encoding="UTF-8"?>
  | <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"; 
debug="true">
  |     <appender name="dailyLogFile" 
class="org.apache.log4j.DailyRollingFileAppender">
  |         <param name="File" value="${log4j.log.dir}/myapp.log"/>
  |         <layout class="org.apache.log4j.PatternLayout">
  |             <param name="ConversionPattern" value="%d %-5p [%c{1}] - %m%n"/>
  |         </layout>
  |     </appender>
  | 
  |     <appender name="email" class="org.apache.log4j.net.SMTPAppender">
  |         <param name="From" value="someemailaddress" />
  |         <param name="To" value="myemailaddress" />
  |         <param name="SMTPHost" value="mymailhost" />
  |         <param name="Subject" value="webapp error" />
  |         <layout class="org.apache.log4j.PatternLayout">
  |             <param name="ConversionPattern" 
value="[%d]%n%n%-5p%n%n%c%n%n%m%n%n" />
  |         </layout>
  |         <filter class="org.apache.log4j.varia.LevelRangeFilter">
  |             <param name="LevelMin" value="ERROR"/>
  |             <param name="LevelMax" value="FATAL"/>
  |         </filter>
  |     </appender>
  |     
  |     <category name="mycategoryname">
  |         <priority value="DEBUG"/>
  |         <appender-ref ref="dailyLogFile"/>
  |         <appender-ref ref="email" />
  |     </category>
  | 
  |     <category name="anothercategoryname">
  |         <priority value="DEBUG" />
  |         <appender-ref ref="dailyLogFile" />
  |     </category>
  |         
  |     <root>
  |         <priority value="WARN"/>
  |         <appender-ref ref="STDOUT"/>
  |     </root>
  | </log4j:configuration>
  | 

Any suggestions?

Thanks

Chris

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3950729#3950729

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3950729


_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to