Results 1 to 2 of 2
  1. #1
    renolovexoxo is offline Member
    Join Date
    Feb 2014
    Posts
    1
    Rep Power
    0

    Default Emailing error logs

    Hello!

    I've been working on a lesson in logging in Java, formatting in XML. I'm trying to add an appender to e-mail the error log, but can't seem to get it to work. Is there a piece I'm missing? The rest of my appenders are working fine. The error I get is that it cannot create an appender of this type. The console also seems to think that I defined the appender after I call for it, but it is above. Here is what I put together:

    <appender name="EMAIL" class="ch.qos.logback.classic.net.SMTPAppender" >
    <filter class="ch.qos.logback.classic.filter.LevelFilter">
    <level>ERROR</level>
    <onMatch>ACCEPT</onMatch>
    <onMismatch>DENY</onMismatch>
    </filter>

    <SMTPHost>${smtpHost}</SMTPHost>
    <to>${emailRecipient}</to>
    <from>${emailSender}</from>
    <subject>${emailSubject} - Job: ${com.minnesotamutual.jobName}</subject>

    <layout class="ch.qos.logback.classic.PatternLayout">
    <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
    </layout>
    </appender>


    And then call it within the logger:
    <appender-ref ref="EMAIL" />

    Any help is greatly appreciated! I'm very new at this. Thank you!

  2. #2
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default Re: Emailing error logs

    This really has nothing to do with Java. You're more likely to get an answer if you ask in the Logback forum or mailing list.
    Get in the habit of using standard Java naming conventions!

Similar Threads

  1. Replies: 0
    Last Post: 09-15-2011, 09:20 AM
  2. Log4j Grouping application logs
    By mhanda in forum New To Java
    Replies: 0
    Last Post: 03-09-2010, 12:19 AM
  3. how to get lucene logs
    By virendra in forum Lucene
    Replies: 0
    Last Post: 01-06-2010, 10:46 AM
  4. Maintaining logs of a chat session
    By vrk in forum AWT / Swing
    Replies: 1
    Last Post: 10-27-2009, 03:18 PM
  5. Replies: 1
    Last Post: 08-27-2009, 11:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •