0 Replies Latest reply on Aug 25, 2014 8:59 AM by vishL kalra

    Use of SMTP to selectively monitor the application logs

    vishL kalra Newbie

      hi,

       

      we have different applications deployed on the jboss server, wherein we have different log files generated per application. Nowe i wanted to use SMTP to monitor and send email for only few of the applications, is there a way to do that ? i tried creating two appender entries but it did not work. Any help/ idea please ??

       

      If not possible to send email for few applications , atleast i need to distinguish between errors for application 1 and application 2. Hence i need something like

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

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

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

           <param name="To" value="vishalkalra@abc.com"/>

           <param name="From" value="admin@Application1"/>

           <param name="Subject" value="Log Errors in application1"/>

           <param name="SMTPHost" value="mail.etn.com"/>

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

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

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

           </layout>

         </appender>

       

       

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

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

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

           <param name="To" value="vishalkalra@abc.com"/>

           <param name="From" value="admin@Application2"/>

           <param name="Subject" value="Log Errors in application2"/>

           <param name="SMTPHost" value="mail.etn.com"/>

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

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

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

           </layout>

         </appender>

       

      How can i achieve it ?