0

I asked this in the jboss forum already but didn't get an answer yet: http://community.jboss.org/message/615861

In JBoss 7.0.0 Final how do I get the SMTPAppender from log4j working?

In standalone/configuration/logging.properties I added the following:

# SMTP
handler.SMTP=org.apache.log4j.net.SMTPAppender
handler.SMTP.level=${jboss.boot.server.log.console.level:WARN}
handler.SMTP.formatter=PATTERN
handler.SMTP.autoFlush=true
handler.SMTP.SMTPHost=smtp.mycompany.com
handler.SMTP.to=me@mycompany.com
handler.SMTP.subject=Testing the appender
handler.SMTP.from=my@mycompany
handler.SMTP.layout=org.apache.handler.SimpleLayout
..

With this starting jboss prints the following:

Failed to configure handler SMTP on Logger '' in context org.jboss.logmanager.LogContext@1549f94: Handler SMTP could not be instantiated
10:50:29,118 INFO  [org.jboss.modules] JBoss Modules version 1.0.1.GA
10:50:29,743 INFO  [org.jboss.msc] JBoss MSC version 1.0.0.GA
10:50:29,836 INFO  [org.jboss.as] JBoss AS 7.0.0.Final "Lightning" starting
...

As mentioned in the forum I couldn't find any documentation but this.

Any ideas how to get this working? Thanks Riggs

Ondra Žižka
  • 43,948
  • 41
  • 217
  • 277
Thomas Traude
  • 840
  • 7
  • 17

1 Answers1

2

I think you just cant use Log4J Handlers with JBoss. JBoss AS7 seems to use java.util.logging.Handler where you need to derive your own handlers from.

eckes
  • 10,103
  • 1
  • 59
  • 71
  • 1
    You're right. I'll have to find out how the new feature works out: https://issues.jboss.org/browse/AS7-1438 and I also follow this thread: http://community.jboss.org/thread/170786 – Thomas Traude Aug 11 '11 at 12:50