Owners Manual

Activating Log4J Email Feature | Portal Configuration
OMNM 6.5.2 User Guide 143
Defining Log4J on Application or Mediation Servers
The application and mediation servers use JBoss, which defines Log4J settings through XML.
Define the log4j email feature on Application or Mediation servers as follows.
1
Go to the .../oware/conf/ directory
2
Find the server-log4j.xml file.
3
Add the following alongside the other <appender> tags:
<!-- If this is present the processing of SMTP will be asynchronous. It
is not required -->
<appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<appender-ref ref="SMTP"/>
</appender>
<!-- These are the main settings. Note that "SMTP" here is just a name.
You choose any name you want
and in fact you can have more than email appender -->
<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="destination@email"/>
<param name="From" value="sender@email"/>
<param name="Subject" value="Testing Log4J Email feature"/>
<param name="SMTPHost" value="email.com.au"/>
<!-- you might need this <param name="TLS" value="true"/> -->
<param name="SMTPUsername" value="myusername"/>
<param name="SMTPPassword" value="mypassword"/> -->
<param name="BufferSize" value="10"/> <-- find an appropriate value
for this -->
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%m"/> <!-- read more at
https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/
PatternLayout.html -->
</layout>
</appender>
4
Find the server-log4j-tail.xml file.
5
Change the file to something like this:
<root>
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
<appender-ref ref="SMTP"/>
</root>
6
Restart the server.