<div dir="ltr">Thanks for the reply Tony, I am glad to know it works and the issue is not with the square brackets then.<div><br></div><div>Could it be my appender/logger configuration then? The situation is, under normal configuration [tomcat's juli logging], my my webapps writes separately to catalina.log and localhost.log. But when I configure logback, the catalina.log only has tomcat logging and all my webapps loggings ends up in localhost.log. Below is my logback.xml:</div>

<div><br></div><div>========================================================</div><div><div><?xml version="1.0" encoding="UTF-8"?></div><div><br></div><div><configuration></div><div><br></div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span><statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener"/></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span><appender name="CONSOLE" class="org.apache.juli.logging.ch.qos.logback.core.ConsoleAppender"></div>
<div><span class="Apple-tab-span" style="white-space:pre">              </span><encoder></div><div><span class="Apple-tab-span" style="white-space:pre">                      </span><pattern>%d{HH:mm:ss.SSS} %-5level {%thread} [%logger{20}] : %msg%n</pattern></div>
<div><span class="Apple-tab-span" style="white-space:pre">              </span></encoder></div><div><span class="Apple-tab-span" style="white-space:pre">     </span></appender></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">   </span><appender name="FILE-CATALINA" class="org.apache.juli.logging.ch.qos.logback.core.rolling.RollingFileAppender"></div>
<div><span class="Apple-tab-span" style="white-space:pre">              </span><file>${catalina.base}/logs/catalina.log</file></div><div><span class="Apple-tab-span" style="white-space:pre">          </span><append>true</append></div>
<div><span class="Apple-tab-span" style="white-space:pre">              </span><encoder></div><div><span class="Apple-tab-span" style="white-space:pre">                      </span><charset>utf-8</charset></div><div><span class="Apple-tab-span" style="white-space:pre">                 </span><pattern>%date{"MMM dd, yyyy HH:mm:ss a"} %C %n%level: %msg%n</pattern></div>
<div><span class="Apple-tab-span" style="white-space:pre">              </span></encoder></div><div><span class="Apple-tab-span" style="white-space:pre">             </span><rollingPolicy class="org.apache.juli.logging.ch.qos.logback.core.rolling.TimeBasedRollingPolicy"></div>
<div><span class="Apple-tab-span" style="white-space:pre">                      </span><fileNamePattern>${catalina.base}/logs/catalina-%d{yyyyMMdd}-%i.log.zip</fileNamePattern> </div><div><span class="Apple-tab-span" style="white-space:pre">                       </span><maxHistory>1<!-- days --></maxHistory></div>
<div><span class="Apple-tab-span" style="white-space:pre">                      </span><timeBasedFileNamingAndTriggeringPolicy class="org.apache.juli.logging.ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"></div><div><span class="Apple-tab-span" style="white-space:pre">                           </span><maxFileSize>10KB</maxFileSize> </div>
<div><span class="Apple-tab-span" style="white-space:pre">                      </span></timeBasedFileNamingAndTriggeringPolicy></div><div><span class="Apple-tab-span" style="white-space:pre">              </span></rollingPolicy></div><div>
<span class="Apple-tab-span" style="white-space:pre"> </span></appender></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">   </span><appender name="FILE-LOCALHOST" class="org.apache.juli.logging.ch.qos.logback.core.rolling.RollingFileAppender"></div>
<div><span class="Apple-tab-span" style="white-space:pre">              </span><file>${catalina.base}/logs/localhost.log</file></div><div><span class="Apple-tab-span" style="white-space:pre">         </span><append>true</append></div>
<div><span class="Apple-tab-span" style="white-space:pre">              </span><encoder></div><div><span class="Apple-tab-span" style="white-space:pre">                      </span><charset>utf-8</charset></div><div><span class="Apple-tab-span" style="white-space:pre">                 </span><pattern>%date{"MMM dd, yyyy HH:mm:ss a"} %c %n%level : %msg%n</pattern></div>
<div><span class="Apple-tab-span" style="white-space:pre">              </span><!--<span class="Apple-tab-span" style="white-space:pre">     </span><pattern>%d{MMM dd, yyyy ;HH:mm:ss} %level : %msg%n</pattern><span class="Apple-tab-span" style="white-space:pre">   </span>--></div>
<div><span class="Apple-tab-span" style="white-space:pre">              </span></encoder></div><div><span class="Apple-tab-span" style="white-space:pre">             </span><rollingPolicy class="org.apache.juli.logging.ch.qos.logback.core.rolling.TimeBasedRollingPolicy"></div>
<div><span class="Apple-tab-span" style="white-space:pre">                      </span><fileNamePattern>${catalina.base}/logs/localhost-%d{yyyyMMdd}-%i.log.zip</fileNamePattern> </div><div><span class="Apple-tab-span" style="white-space:pre">                      </span><maxHistory>60<!-- days --></maxHistory></div>
<div><span class="Apple-tab-span" style="white-space:pre">                      </span><timeBasedFileNamingAndTriggeringPolicy class="org.apache.juli.logging.ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"></div><div><span class="Apple-tab-span" style="white-space:pre">                           </span><maxFileSize>10KB</maxFileSize> </div>
<div><span class="Apple-tab-span" style="white-space:pre">                      </span></timeBasedFileNamingAndTriggeringPolicy></div><div><span class="Apple-tab-span" style="white-space:pre">              </span></rollingPolicy></div><div>
<span class="Apple-tab-span" style="white-space:pre"> </span></appender></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">   </span><logger name="org.apache.catalina" level="INFO" additivity="false"></div>
<div><span class="Apple-tab-span" style="white-space:pre">              </span><appender-ref ref="FILE-CATALINA" /></div><div><span class="Apple-tab-span" style="white-space:pre"> </span></logger></div><div><span class="Apple-tab-span" style="white-space:pre">      </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span><logger name="org.apache.catalina.session" level="INFO" additivity="false"></div><div><span class="Apple-tab-span" style="white-space:pre">              </span><appender-ref ref="FILE-CATALINA" /></div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span></logger></div><div><span class="Apple-tab-span" style="white-space:pre">      </span></div><div><span class="Apple-tab-span" style="white-space:pre">     </span><logger name="org.apache.catalina.core" level="INFO" additivity="false"></div>
<div><span class="Apple-tab-span" style="white-space:pre">              </span><appender-ref ref="FILE-CATALINA" /></div><div><span class="Apple-tab-span" style="white-space:pre"> </span></logger></div><div><span class="Apple-tab-span" style="white-space:pre">      </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span><logger name="org.apache.catalina.core.ContainerBase.[Catalina].[localhost]" level="INFO" additivity="false"></div><div>
<span class="Apple-tab-span" style="white-space:pre">         </span><appender-ref ref="FILE-CATALINA" /></div><div><span class="Apple-tab-span" style="white-space:pre">         </span><appender-ref ref="FILE-LOCALHOST" /><span class="Apple-tab-span" style="white-space:pre">               </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span></logger></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">     </span><root level="INFO"></div><div><span class="Apple-tab-span" style="white-space:pre">          </span><appender-ref ref="CONSOLE" /></div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span></root></div><div><br></div><div></configuration></div></div><div><br></div><div>========================================================
</div><div><br></div><div>This is on Windows Server 2008, Tomcat6.</div><div><br></div><div>Can you suggest anything to rectify this?</div><div>Thanks</div><div><br></div><div>Noman A. <br><br><div class="gmail_quote">
On Wed, Jan 4, 2012 at 3:38 PM, Tony Trinh <span dir="ltr"><<a href="mailto:tony19@gmail.com" target="_blank">tony19@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

I just tried logback.xml with square brackets in the logger name and didn't see any apparent problems (the logger printed log statements as expected). <div><br></div><div>-Tony<br><br><div class="gmail_quote"><div><div>

On Wed, Jan 4, 2012 at 4:42 AM, Noman Amir Jamil <span dir="ltr"><<a href="mailto:n.amir.jamil@gmail.com" target="_blank">n.amir.jamil@gmail.com</a>></span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">Hi,<div><br></div><div>I would like to know if the following issue is resolved in logback, it was previously encountered in log4j:</div>



<div><br></div><div><span style="font-family:'Times New Roman';background-color:rgb(255,255,255);font-size:medium">"there are known issues with using this naming convention (with square brackets) in log4j XML based configuration files"</span></div>




<div><span style="font-family:'Times New Roman';background-color:rgb(255,255,255);font-size:medium"><br></span></div><div><font face="'Times New Roman'" size="3">I am using a similar configuration with square brackets:</font></div>




<div><font face="'Times New Roman'" size="3"><br></font></div><div><font face="'Times New Roman'" size="3"><div>logger name="org.apache.catalina.core.ContainerBase.[Catalina].[localhost]" level="INFO" additivity="false"></div>




<div><br></div><div>But it appears that the portion after ContainerBase is being ignored or not processed.</div><div><br></div><div>I would really appreciate any help on this.</div><div><br></div><div>Thanks</div><div>Noman A.</div>




</font></div></div>
<br></div></div>_______________________________________________<br>
Logback-user mailing list<br>
<a href="mailto:Logback-user@qos.ch" target="_blank">Logback-user@qos.ch</a><br>
<a href="http://mailman.qos.ch/mailman/listinfo/logback-user" target="_blank">http://mailman.qos.ch/mailman/listinfo/logback-user</a><br></blockquote></div><br></div>
<br>_______________________________________________<br>
Logback-user mailing list<br>
<a href="mailto:Logback-user@qos.ch" target="_blank">Logback-user@qos.ch</a><br>
<a href="http://mailman.qos.ch/mailman/listinfo/logback-user" target="_blank">http://mailman.qos.ch/mailman/listinfo/logback-user</a><br></blockquote></div><br></div></div>