The PatternLayout has header/footer attributes to set some string for the beginning and end of each log file. http://logging.apache.org/log4j/2.x/manual/layouts.html#PatternLayout I'm not sure if it will be included in every email but it is worth trying.
On Tue, Jul 22, 2014 at 8:29 PM, VolkerKopetzky <[email protected]> wrote: > 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="[email protected]"/> > <param name="From" value="[email protected]"/> > <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 [email protected] > wsite http://www.vzkb.de > > >
