logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "VERNIER Dominique" <dvern...@relaystar.com>
Subject Add enviroment variable into PatternLayout
Date Fri, 02 Sep 2005 06:59:12 GMT

I setup my application to receive email on error via STMPAppender. I
have multiple environment (Dev, Test, Staging and Production) and I
would like to have the environment name in the message.

I have an envionment variable target-environment on I tried to put it in
the parternLayout like:

		<layout class="org.apache.log4j.PatternLayout">
			<param name="ConversionPattern"
value="${target-environment} %d{HH:mm:ss} %-5p %.11X{StationConfig}
%.20c{1} - %.100m%n"/>

But it doesn't work, the logger crashes.

Does somebody have an idea or should I extend the SMTPAppender to add
this environment variable as parameter and insert it in the message


View raw message