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

The insertion of a percent symbol causes the Parser to crash

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • None
    • None
    • logback-core
    • None
    • Operating System: All
      Platform: All

    • 8

    Description

      When inserting the percent char twice, so that it appears in the PatternLayout output, a number format exception is thrown.

      It does not prevent from using normally the PatternLayout.

      trace:

      ERROR in ch.qos.logback.core.joran.spi.Interpreter@131f71a - Exception in Action for tag <layout>8:14 java.lang.NumberFormatException: For input string: "% %"
      java.lang.NumberFormatException: For input string: "% %"
      at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
      at java.lang.Integer.parseInt(Integer.java:447)
      at java.lang.Integer.parseInt(Integer.java:497)
      at ch.qos.logback.core.pattern.FormatInfo.valueOf(FormatInfo.java:70)
      at ch.qos.logback.core.pattern.parser.Parser.T(Parser.java:84)
      at ch.qos.logback.core.pattern.parser.Parser.E(Parser.java:51)
      at ch.qos.logback.core.pattern.parser.Parser.Eopt(Parser.java:107)
      at ch.qos.logback.core.pattern.parser.Parser.E(Parser.java:55)
      at ch.qos.logback.core.pattern.parser.Parser.Eopt(Parser.java:107)
      at ch.qos.logback.core.pattern.parser.Parser.E(Parser.java:55)
      at ch.qos.logback.core.pattern.parser.Parser.Eopt(Parser.java:107)
      at ch.qos.logback.core.pattern.parser.Parser.E(Parser.java:55)
      at ch.qos.logback.core.pattern.parser.Parser.Eopt(Parser.java:107)
      at ch.qos.logback.core.pattern.parser.Parser.E(Parser.java:55)
      at ch.qos.logback.core.pattern.parser.Parser.Eopt(Parser.java:107)
      at ch.qos.logback.core.pattern.parser.Parser.E(Parser.java:55)
      at ch.qos.logback.core.pattern.parser.Parser.Eopt(Parser.java:107)
      at ch.qos.logback.core.pattern.parser.Parser.E(Parser.java:55)
      at ch.qos.logback.core.pattern.parser.Parser.Eopt(Parser.java:107)
      at ch.qos.logback.core.pattern.parser.Parser.E(Parser.java:55)
      at ch.qos.logback.core.pattern.parser.Parser.Eopt(Parser.java:107)
      at ch.qos.logback.core.pattern.parser.Parser.E(Parser.java:55)
      at ch.qos.logback.core.pattern.parser.Parser.parse(Parser.java:31)
      at ch.qos.logback.core.pattern.PatternLayoutBase.start(PatternLayoutBase.java:76)
      at ch.qos.logback.core.joran.action.AbstractLayoutAction.end(AbstractLayoutAction.java:75)
      at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:289)
      at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:152)
      at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:633)
      at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(XMLNSDocumentScannerImpl.java:719)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
      at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
      at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
      at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
      at ch.qos.logback.core.joran.JoranConfiguratorBase.doConfigure(JoranConfiguratorBase.java:125)
      at ch.qos.logback.core.joran.JoranConfiguratorBase.doConfigure(JoranConfiguratorBase.java:101)
      at ch.qos.logback.core.joran.JoranConfiguratorBase.doConfigure(JoranConfiguratorBase.java:84)
      at ch.qos.logback.core.joran.JoranConfiguratorBase.doConfigure(JoranConfiguratorBase.java:77)
      at mainPackage.ConfigTester.main(ConfigTester.java:21)

      Attachments

        Activity

          People

            logback-dev Logback dev list
            noreply.sebastien@qos.ch Sébastien Pennec
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: