7 Replies Latest reply on Dec 6, 2012 4:59 AM by abhishek.cse4u

    Logging in JBoss 7 Final: SMTP possible?

    riggs

      Hi,

       

      migrating my app from JBoss 4.2 to 7 Final I wondering how I can send the messages on the loglevel WARN per mail.

      In JBoss 4.2 I had to edit the jboss-log4j.xml as follows:

       

       

      {code:xml}

      <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">

      ...

        <!-- EMail events to an administrator -->

         <appender name="SMTP" class="org.apache.log4j.net.SMTPAppender">

           <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>

           <param name="Threshold" value="WARN"/>

           <param name="To" value="me@mycompany.com"/>

           <param name="From" value="myapp@mycompany.com"/>

           <param name="Subject" value="JBoss Server Errors"/>

           <param name="SMTPHost" value="smtp.mycompany.com"/>

           <param name="BufferSize" value="10"/>

           <layout class="org.apache.log4j.PatternLayout">

             <param name="ConversionPattern" value="[%d{ABSOLUTE},%c{1}] %m%n"/>

           </layout>

         </appender>

      ...

         <root>

            <priority value="INFO" />

            <appender-ref ref="CONSOLE"/>

            <appender-ref ref="FILE"/>

            <appender-ref ref="SMTP"/>

         </root>

      </log4j:configuration>

       

      {code}

       

      Is there a way to fulfill this requirement with JBoss 7? I already found the subsystem in the standalone.xml:

       

      {code:xml}

      ...

      <subsystem xmlns="urn:jboss:domain:logging:1.0">

      ...

      {code}

       

      But I didn't found any documentation for an SMTPAppender or something like this. (The schema file jboss-logging.xsd hasn't helped me so far.)

       

      Does anybody have an idea?


      Thx!

      Thomas