Hi,<br><br>I have a couple of applications running on one tomcat instance.&nbsp; I use the following xml file for each application substituting contextX for the<br>application name, however, when I start tomcat only one context is initialized and all log messages are sent to that context.
<br><br>Is it possible to have a log file for each application in a tomcat instance?<br><br>Thanks,<br><br>Chris.<br><br>[code]<br>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;<br>&lt;configuration&gt;
<br><br>&nbsp; &lt;appender name=&quot;stdout&quot; class=&quot;ch.qos.logback.core.ConsoleAppender&quot;&gt;<br>&nbsp;&nbsp;&nbsp; &lt;rollingPolicy class=&quot;ch.qos.logback.core.rolling.FixedWindowRollingPolicy&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;FileNamePattern&gt;/var/log/tomcat6/catalina.%i.out&lt;/FileNamePattern&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;MinIndex&gt;1&lt;/MinIndex&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;MaxIndex&gt;7&lt;/MaxIndex&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/rollingPolicy&gt;<br>&nbsp;&nbsp;&nbsp; &lt;triggeringPolicy class=&quot;ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy&quot;&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;MaxFileSize&gt;5MB&lt;/MaxFileSize&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/triggeringPolicy&gt;&nbsp;&nbsp; &nbsp;<br>&nbsp;&nbsp;&nbsp; &lt;layout class=&quot;ch.qos.logback.classic.PatternLayout&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;pattern&gt;%d %-5level [%thread] %class | %msg%n&lt;/pattern&gt;
<br>&nbsp;&nbsp;&nbsp; &lt;/layout&gt;&nbsp;&nbsp; &nbsp;<br>&nbsp; &lt;/appender&gt;<br>&nbsp;<br>&nbsp; &lt;appender name=&quot;contextX&quot; class=&quot;ch.qos.logback.core.rolling.RollingFileAppender&quot;&gt;<br>&nbsp;&nbsp;&nbsp; &lt;File&gt;/var/log/tomcat6/contextX.log&lt;/File&gt;
<br>&nbsp;&nbsp;&nbsp; &lt;rollingPolicy<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class=&quot;ch.qos.logback.core.rolling.TimeBasedRollingPolicy&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;FileNamePattern&gt;/var/log/tomcat6/contextX.%d.log&lt;/FileNamePattern&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/rollingPolicy&gt;
<br>&nbsp;&nbsp;&nbsp; &lt;layout class=&quot;ch.qos.logback.classic.PatternLayout&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;pattern&gt;%date{ISO8601} %-5level [%thread] %class | %msg%n&lt;/pattern&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/layout&gt;<br>&nbsp;&nbsp;&nbsp; &lt;Encoding&gt;UTF-8&lt;/Encoding&gt;
<br>&nbsp;&nbsp;&nbsp; &lt;BufferedIO&gt;false&lt;/BufferedIO&gt;<br>&nbsp;&nbsp;&nbsp; &lt;ImmediateFlush&gt;true&lt;/ImmediateFlush&gt;<br>&nbsp; &lt;/appender&gt;<br>&nbsp;<br>&nbsp; &lt;logger name=&quot;org.springframework&quot; additivity=&quot;false&quot;&gt;
<br>&nbsp;&nbsp;&nbsp; &lt;level value=&quot;WARN&quot;/&gt;<br>&nbsp;&nbsp;&nbsp; &lt;appender-ref ref=&quot;contextX&quot; /&gt;<br>&nbsp; &lt;/logger&gt;<br>&nbsp; &lt;logger name=&quot;com.contextX&quot; additivity=&quot;false&quot;&gt;<br>&nbsp;&nbsp;&nbsp; &lt;level value=&quot;WARN&quot;/&gt;
<br>&nbsp;&nbsp;&nbsp; &lt;appender-ref ref=&quot;contextX&quot; /&gt;<br>&nbsp; &lt;/logger&gt;<br>&nbsp; &lt;logger name=&quot;org.hibernate&quot; additivity=&quot;false&quot;&gt;<br>&nbsp;&nbsp;&nbsp; &lt;level value=&quot;WARN&quot;/&gt;<br>&nbsp;&nbsp;&nbsp; &lt;appender-ref ref=&quot;contextX&quot; /&gt;&nbsp;&nbsp; &nbsp;
<br>&nbsp; &lt;/logger&gt;<br>&nbsp; &lt;logger name=&quot;org.apache.velocity&quot; additivity=&quot;false&quot;&gt;<br>&nbsp;&nbsp;&nbsp; &lt;level value=&quot;WARN&quot;/&gt;<br>&nbsp;&nbsp;&nbsp; &lt;appender-ref ref=&quot;contextX&quot; /&gt;&nbsp;&nbsp; &nbsp;<br>&nbsp; &lt;/logger&gt;
<br>&nbsp; &lt;logger name=&quot;org.acegisecurity&quot; additivity=&quot;false&quot;&gt;<br>&nbsp;&nbsp;&nbsp; &lt;level value=&quot;INFO&quot;/&gt;<br>&nbsp;&nbsp;&nbsp; &lt;appender-ref ref=&quot;contextX&quot; /&gt;&nbsp;&nbsp; &nbsp;<br>&nbsp; &lt;/logger&gt;<br>&nbsp; &lt;logger name=&quot;
org.directwebremoting&quot; additivity=&quot;false&quot;&gt;<br>&nbsp;&nbsp;&nbsp; &lt;level value=&quot;WARN&quot;/&gt;<br>&nbsp;&nbsp;&nbsp; &lt;appender-ref ref=&quot;contextX&quot; /&gt;&nbsp;&nbsp; &nbsp;<br>&nbsp; &lt;/logger&gt;<br>&nbsp;<br>&nbsp; &lt;logger name=&quot;org.apache
&quot; additivity=&quot;false&quot;&gt;<br>&nbsp;&nbsp;&nbsp; &lt;level value=&quot;WARN&quot;/&gt;<br>&nbsp;&nbsp;&nbsp; &lt;appender-ref ref=&quot;stdout&quot; /&gt;<br>&nbsp; &lt;/logger&gt;<br>&nbsp;<br>&nbsp; &lt;root&gt;<br>&nbsp;&nbsp;&nbsp; &lt;level value=&quot;WARN&quot;/&gt;
<br>&nbsp;&nbsp;&nbsp; &lt;appender-ref ref=&quot;stdout&quot;/&gt;<br>&nbsp; &lt;/root&gt;<br>&lt;/configuration&gt;<br>[code]<br><br>