Are special charcters allowed in logger configurations?

Hi, I would like to know if the following issue is resolved in logback, it was previously encountered in log4j: "there are known issues with using this naming convention (with square brackets) in log4j XML based configuration files" I am using a similar configuration with square brackets: logger name="org.apache.catalina.core.ContainerBase.[Catalina].[localhost]" level="INFO" additivity="false"> But it appears that the portion after ContainerBase is being ignored or not processed. I would really appreciate any help on this. Thanks Noman A.

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). -Tony On Wed, Jan 4, 2012 at 4:42 AM, Noman Amir Jamil <n.amir.jamil@gmail.com>wrote:
Hi,
I would like to know if the following issue is resolved in logback, it was previously encountered in log4j:
"there are known issues with using this naming convention (with square brackets) in log4j XML based configuration files"
I am using a similar configuration with square brackets:
logger name="org.apache.catalina.core.ContainerBase.[Catalina].[localhost]" level="INFO" additivity="false">
But it appears that the portion after ContainerBase is being ignored or not processed.
I would really appreciate any help on this.
Thanks Noman A.
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user

Thanks for the reply Tony, I am glad to know it works and the issue is not with the square brackets then. 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: ======================================================== <?xml version="1.0" encoding="UTF-8"?> <configuration> <statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener"/> <appender name="CONSOLE" class="org.apache.juli.logging.ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern>%d{HH:mm:ss.SSS} %-5level {%thread} [%logger{20}] : %msg%n</pattern> </encoder> </appender> <appender name="FILE-CATALINA" class="org.apache.juli.logging.ch.qos.logback.core.rolling.RollingFileAppender"> <file>${catalina.base}/logs/catalina.log</file> <append>true</append> <encoder> <charset>utf-8</charset> <pattern>%date{"MMM dd, yyyy HH:mm:ss a"} %C %n%level: %msg%n</pattern> </encoder> <rollingPolicy class="org.apache.juli.logging.ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <fileNamePattern>${catalina.base}/logs/catalina-%d{yyyyMMdd}-%i.log.zip</fileNamePattern> <maxHistory>1<!-- days --></maxHistory> <timeBasedFileNamingAndTriggeringPolicy class="org.apache.juli.logging.ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> <maxFileSize>10KB</maxFileSize> </timeBasedFileNamingAndTriggeringPolicy> </rollingPolicy> </appender> <appender name="FILE-LOCALHOST" class="org.apache.juli.logging.ch.qos.logback.core.rolling.RollingFileAppender"> <file>${catalina.base}/logs/localhost.log</file> <append>true</append> <encoder> <charset>utf-8</charset> <pattern>%date{"MMM dd, yyyy HH:mm:ss a"} %c %n%level : %msg%n</pattern> <!-- <pattern>%d{MMM dd, yyyy ;HH:mm:ss} %level : %msg%n</pattern> --> </encoder> <rollingPolicy class="org.apache.juli.logging.ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <fileNamePattern>${catalina.base}/logs/localhost-%d{yyyyMMdd}-%i.log.zip</fileNamePattern> <maxHistory>60<!-- days --></maxHistory> <timeBasedFileNamingAndTriggeringPolicy class="org.apache.juli.logging.ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> <maxFileSize>10KB</maxFileSize> </timeBasedFileNamingAndTriggeringPolicy> </rollingPolicy> </appender> <logger name="org.apache.catalina" level="INFO" additivity="false"> <appender-ref ref="FILE-CATALINA" /> </logger> <logger name="org.apache.catalina.session" level="INFO" additivity="false"> <appender-ref ref="FILE-CATALINA" /> </logger> <logger name="org.apache.catalina.core" level="INFO" additivity="false"> <appender-ref ref="FILE-CATALINA" /> </logger> <logger name="org.apache.catalina.core.ContainerBase.[Catalina].[localhost]" level="INFO" additivity="false"> <appender-ref ref="FILE-CATALINA" /> <appender-ref ref="FILE-LOCALHOST" /> </logger> <root level="INFO"> <appender-ref ref="CONSOLE" /> </root> </configuration> ======================================================== This is on Windows Server 2008, Tomcat6. Can you suggest anything to rectify this? Thanks Noman A. On Wed, Jan 4, 2012 at 3:38 PM, Tony Trinh <tony19@gmail.com> wrote:
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).
-Tony
On Wed, Jan 4, 2012 at 4:42 AM, Noman Amir Jamil <n.amir.jamil@gmail.com>wrote:
Hi,
I would like to know if the following issue is resolved in logback, it was previously encountered in log4j:
"there are known issues with using this naming convention (with square brackets) in log4j XML based configuration files"
I am using a similar configuration with square brackets:
logger name="org.apache.catalina.core.ContainerBase.[Catalina].[localhost]" level="INFO" additivity="false">
But it appears that the portion after ContainerBase is being ignored or not processed.
I would really appreciate any help on this.
Thanks Noman A.
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user

I'm not all that familiar with org.apache.juli, but your appender class names look bizarre to me. For instance: org.apache.juli.logging.ch.qos.logback.core.rolling.RollingFileAppender I think that should be: ch.qos.logback.core.rolling.RollingFileAppender Or is this intentional? -Tony On Wed, Jan 4, 2012 at 6:56 AM, Noman Amir Jamil <n.amir.jamil@gmail.com>wrote:
org.apache.juli.logging

Yes Tony, because I am using the tomcat-jul-sl4j-logback setup as described here : https://github.com/grgrzybek/tomcat-slf4j-logback -Noman A. On Wed, Jan 4, 2012 at 6:17 PM, Tony Trinh <tony19@gmail.com> wrote:
I'm not all that familiar with org.apache.juli, but your appender class names look bizarre to me. For instance:
org.apache.juli.logging.ch.qos.logback.core.rolling.RollingFileAppender
I think that should be:
ch.qos.logback.core.rolling.RollingFileAppender
Or is this intentional?
-Tony
On Wed, Jan 4, 2012 at 6:56 AM, Noman Amir Jamil <n.amir.jamil@gmail.com>wrote:
org.apache.juli.logging
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user
participants (2)
-
Noman Amir Jamil
-
Tony Trinh