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

Beautification of error message in Logger.createChildByName()

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 1.0.9
    • logback-classic
    • None
    • Linux / Eclipse

    Description

      ch.qos.logback.classic.Logger.createChildByName() may throw an exception if it finds a DOT or a DOLLAR in the childName passed to it.

      Currently the following text is generated:

      throw new IllegalArgumentException("For logger [" + this.name
      + "] child name [" + childName
      + " passed as parameter, may not include '.' after index"
      + (this.name.length() + 1));

      It turns out that the separator of a Logger name is DOT, but for the last string not containing any DOT it is DOLLAR. The exception should thus read, adding some missing formatting:

      throw new IllegalArgumentException("For logger [" + this.name
      + "], child name [" + childName
      + "] passed as parameter shall not include the separators '"
      + CoreConstants.DOT + ' or ' + CoreConstants.DOLLAR +
      + "' after position "
      + (this.name.length() + 1));

      Attachments

        Activity

          People

            logback-dev Logback dev list
            dtonhofer David Tonhofer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: