[JIRA] Created: (LBCLASSIC-306) Mixing periods and dollar signs in a logger name causes IllegalArgumentException from LoggerFactory.getLogger

Mixing periods and dollar signs in a logger name causes IllegalArgumentException from LoggerFactory.getLogger ------------------------------------------------------------------------------------------------------------- Key: LBCLASSIC-306 URL: http://jira.qos.ch/browse/LBCLASSIC-306 Project: logback-classic Issue Type: Bug Affects Versions: 1.0.0 Reporter: Michael Pilquist Assignee: Logback dev list When mixing periods and dollar signs in a logger name, an IllegalArgumentException is thrown from LoggerFactory.getLogger: scala> org.slf4j.LoggerFactory.getLogger("a.b$c.d") java.lang.IllegalArgumentException: For logger [a] child name [a.b$c passed as parameter, may not include '.' after index2 at ch.qos.logback.classic.Logger.createChildByName(Logger.java:386) at ch.qos.logback.classic.LoggerContext.getLogger(LoggerContext.java:152) at ch.qos.logback.classic.LoggerContext.getLogger(LoggerContext.java:48) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:253) Note that the following works: scala> org.slf4j.LoggerFactory.getLogger("a$b.c") res0: org.slf4j.Logger = Logger[a$b.c] -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCLASSIC-306?page=com.atlassian.jira.plugin.syste... ] Ceki Gulcu commented on LBCLASSIC-306: -------------------------------------- Have you tried with the same string value ? scala> org.slf4j.LoggerFactory.getLogger("a.b$c.d")
Mixing periods and dollar signs in a logger name causes IllegalArgumentException from LoggerFactory.getLogger -------------------------------------------------------------------------------------------------------------
Key: LBCLASSIC-306 URL: http://jira.qos.ch/browse/LBCLASSIC-306 Project: logback-classic Issue Type: Bug Affects Versions: 1.0.0 Reporter: Michael Pilquist Assignee: Logback dev list
When mixing periods and dollar signs in a logger name, an IllegalArgumentException is thrown from LoggerFactory.getLogger: scala> org.slf4j.LoggerFactory.getLogger("a.b$c.d") java.lang.IllegalArgumentException: For logger [a] child name [a.b$c passed as parameter, may not include '.' after index2 at ch.qos.logback.classic.Logger.createChildByName(Logger.java:386) at ch.qos.logback.classic.LoggerContext.getLogger(LoggerContext.java:152) at ch.qos.logback.classic.LoggerContext.getLogger(LoggerContext.java:48) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:253) Note that the following works: scala> org.slf4j.LoggerFactory.getLogger("a$b.c") res0: org.slf4j.Logger = Logger[a$b.c]
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCLASSIC-306?page=com.atlassian.jira.plugin.syste... ] Michael Pilquist commented on LBCLASSIC-306: -------------------------------------------- Sorry, I'm not sure what you mean. Using the string "a.b$c.d" results in an IllegalArgumentException on every invocation of LoggerFactory.getLogger. The second example was just to show that using a period after a dollar sign works as long as there's no period before the dollar sign.
Mixing periods and dollar signs in a logger name causes IllegalArgumentException from LoggerFactory.getLogger -------------------------------------------------------------------------------------------------------------
Key: LBCLASSIC-306 URL: http://jira.qos.ch/browse/LBCLASSIC-306 Project: logback-classic Issue Type: Bug Affects Versions: 1.0.0 Reporter: Michael Pilquist Assignee: Logback dev list
When mixing periods and dollar signs in a logger name, an IllegalArgumentException is thrown from LoggerFactory.getLogger: scala> org.slf4j.LoggerFactory.getLogger("a.b$c.d") java.lang.IllegalArgumentException: For logger [a] child name [a.b$c passed as parameter, may not include '.' after index2 at ch.qos.logback.classic.Logger.createChildByName(Logger.java:386) at ch.qos.logback.classic.LoggerContext.getLogger(LoggerContext.java:152) at ch.qos.logback.classic.LoggerContext.getLogger(LoggerContext.java:48) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:253) Note that the following works: scala> org.slf4j.LoggerFactory.getLogger("a$b.c") res0: org.slf4j.Logger = Logger[a$b.c]
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCLASSIC-306?page=com.atlassian.jira.plugin.syste... ] Ceki Gulcu commented on LBCLASSIC-306: -------------------------------------- As you mentioned Scala in the second example, I misread your example and hought for a second that there was a problem in Java but not when the same example was run under Scala (which seemed rather implausible). Sorry for the confusion.
Mixing periods and dollar signs in a logger name causes IllegalArgumentException from LoggerFactory.getLogger -------------------------------------------------------------------------------------------------------------
Key: LBCLASSIC-306 URL: http://jira.qos.ch/browse/LBCLASSIC-306 Project: logback-classic Issue Type: Bug Affects Versions: 1.0.0 Reporter: Michael Pilquist Assignee: Logback dev list
When mixing periods and dollar signs in a logger name, an IllegalArgumentException is thrown from LoggerFactory.getLogger: scala> org.slf4j.LoggerFactory.getLogger("a.b$c.d") java.lang.IllegalArgumentException: For logger [a] child name [a.b$c passed as parameter, may not include '.' after index2 at ch.qos.logback.classic.Logger.createChildByName(Logger.java:386) at ch.qos.logback.classic.LoggerContext.getLogger(LoggerContext.java:152) at ch.qos.logback.classic.LoggerContext.getLogger(LoggerContext.java:48) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:253) Note that the following works: scala> org.slf4j.LoggerFactory.getLogger("a$b.c") res0: org.slf4j.Logger = Logger[a$b.c]
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

participants (3)
-
Ceki Gulcu (JIRA)
-
Fab (JIRA)
-
Michael Pilquist (JIRA)