Hello, i want Axon Ivy to send an Email when there is an error so i added this code to "log4jconfig.xml":

< appender name="EmailAppender" class="org.apache.log4j.net.SMTPAppender">
        < param name="BufferSize" value="512" / >
        < param name="SMTPHost" value="smtp.gmail.com" / > 
        < param name="SMTPProtocol" value="smtps" / >
        < param name="SMTPPort" value="465" / >
        < param name="SMTPUsername" value=" *** " / >
        < param name="SMTPPassword" value=" *** " / >
        < param name="From" value=" *** " / >
        < param name="To" value=" *** " / >
        < param name="Subject" value="Testing Log4j Mail Notification" / >
        < layout class="org.apache.log4j.PatternLayout">
            < param name="ConversionPattern" value="%-7p %d [%t] %c %x - %m%n" / >
        < /layout >
    < /appender >

  < root > 
    < level value ="WARN" / > 
    < appender-ref ref="FileLog"/ > 
    < appender-ref ref="EmailAppender"/ >
    < appender-ref ref="ConsoleAppender"/ >    
    < /root >

The FileLog works but i dont receive the email. When i change the order to this:

< appender-ref ref="EmailAppender"/ >
< appender-ref ref="FileLog"/ >

then the FileLog and the MailAppender doesn't work.
When i use the same code in an Eclipse Java Project it works and i get the email.

What should i do?

Edit: Do i have to add mail.jar and activation.jar to my build path in Axon Ivy? In Eclipse i added them to lib and it worked but i don't know how to integrate them to Axon Ivy.

asked 03.01 at 05:05

karstenk's gravatar image

karstenk
112
accept rate: 0%

edited 11.01 at 05:52

May be you defined the appender at the wrong location in the log4jconfig.xml? All Appenders must be together!

(08.01 at 10:25) Christian St... ♦ Christian%20Strebel's gravatar image

Thanks for your answer but all Appenders are together.

(11.01 at 05:49) karstenk karstenk's gravatar image
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×30
×20
×5
×5

Asked: 03.01 at 05:05

Seen: 32 times

Last updated: 11.01 at 05:52