Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-384

Mixing periods and dollar signs in a logger name causes IllegalArgumentException from LoggerFactory.getLogger

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0
    • Fix Version/s: 1.1.0
    • Component/s: None
    • Labels:
      None

      Description

      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]

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tony19 Tony Trinh
                Reporter:
                mpilquist Michael Pilquist
              • Votes:
                2 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: