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

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

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.1.0
    • 1.0.0
    • None
    • 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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: