[logback-user] How to avoid modifying logback.xml in different environments?

hezjing hezjing at gmail.com
Tue Aug 25 07:38:32 CEST 2009


Hi
My logback.xml contains the following RollingFileAppender configuration:

<appender name="FILE"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>/usr/share/tomcat5/logs/Dummy.log</File>
<RollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<FileNamePattern>Dummy.%d.log</FileNamePattern>
<MaxHistory>120</MaxHistory>
</RollingPolicy>
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</Pattern>
</layout>
</appender>


The log file is created in /usr/share/tomcat5/logs, which is on the
production Unix server.

The problem is my development environment is on Windows, and Tomcat in a
different directory,
so I have to modify the directory every time before I deployed the
application to the production server.


Is there a convenient way that I don't have to modify logback.xml, and share
the same logback.xml in different environments?


Thank you!


-- 

Hez
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/logback-user/attachments/20090825/4433f52c/attachment.htm>


More information about the Logback-user mailing list