[logback-dev] [JIRA] Commented: (LBCORE-4) The insertion of a percent symbol causes the Parser to crash

Selen Schabenberger (JIRA) noreply-jira at qos.ch
Tue Apr 26 17:11:51 CEST 2011


    [ http://jira.qos.ch/browse/LBCORE-4?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12006#action_12006 ] 

Selen Schabenberger commented on LBCORE-4:
------------------------------------------

This issue is still reproducable in release 0.9.21 if the policy (FixedWindowRollingPolicy) is defined programmatically. FileNamePattern class is converting all backslashes to slashes in its contructor; therefore it is not possible to assign a file name pattern with an escaped percent sign. Is it a restriction or a bug?

> The insertion of a percent symbol causes the Parser to crash
> ------------------------------------------------------------
>
>                 Key: LBCORE-4
>                 URL: http://jira.qos.ch/browse/LBCORE-4
>             Project: logback-core
>          Issue Type: Bug
>          Components: Pattern
>    Affects Versions: unspecified
>         Environment: Operating System: All
> Platform: All
>            Reporter: Sébastien Pennec
>            Assignee: Logback dev list
>            Priority: Blocker
>
> 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 at 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)

-- 
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

       


More information about the logback-dev mailing list