logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From VolkerKopetzky ...@vzkb.de>
Subject How to set email message header with SMTPAppender and PatternLayout
Date Tue, 22 Jul 2014 11:29:56 GMT
Hi,

I'm using log4j 1.2.15.

The Appender used for email is:

<appender name="ErrorNotifier" class="org.apache.log4j.net.SMTPAppender">
	<param name="Threshold" value="ERROR"/>
	<param name="To" value="mail@somewhere.com"/>
	<param name="From" value="mail@somewhere.com"/>
	<param name="SMTPHost" value="smtp.mail.com"/>
	<param name="BufferSize" value="100"/>
	<param name="Subject" value="New Error!"/>
	<layout class="org.apache.log4j.PatternLayout">
		<param name="ConversionPattern" value="%-5p %d{ISO8601} - %m%n"/>
	</layout>
</appender>

This works nicely, yet I would like to add additional email message headers to the message.

Is that possible?

If so, how can I add, for example this header to the email send by the Appender:
X-System-Postid: post12345
X-System-Forumid: forum12345

Many thanx in advance!!

Beste Grüße, kind regards,
Volker Kopetzky
vzk Beratung
Germany & Thailand

phone	   +49.6809.2163.30
phone	   +66.86.143.77.27
skype	   volker.kopetzky
email	   vk@vzkb.de
wsite	   http://www.vzkb.de



Mime
View raw message