ch.qos.logback.core.spi.ScanException: Failed to initialize Parser

QOS.ch JIRA | L.Viegas | 1 year ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Using this onfiguration file: {code:xml|title=logback.xml} <configuration debug="true" scan="true" scanPeriod="5 seconds"> <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern>%d{HH:mm:ss.SSS} %boldBlue(%-5level) [%yellow(%thread)] %logger{36}\(%blue(%M):%blue(%L)\) - %green(%msg%n)</pattern> </encoder> </appender> <root level="INFO"> <appender-ref ref="CONSOLE"/> </root> </configuration> {code} The following exception is thrown: {code:java} 08:53:23,848 |-ERROR in ch.qos.logback.classic.PatternLayout("%d{HH:mm:ss.SSS} %boldBlue(%-5level) [%yellow(%thread)] %logger{36} \(%blue(%M):%blue(%L)\) - %green(%msg%n)") - Failed to parse pattern "%d{HH:mm:ss.SSS} %boldBlue(%-5level) [%yellow(%thread)] %logger{36} \(%blue(%M):%blue(%L)\) - %green(%msg%n)". ch.qos.logback.core.spi.ScanException: Failed to initialize Parser at ch.qos.logback.core.spi.ScanException: Failed to initialize Parser at at ch.qos.logback.core.pattern.parser.Parser.<init>(Parser.java:74) at at ch.qos.logback.core.pattern.parser.Parser.<init>(Parser.java:66) at at ch.qos.logback.core.pattern.PatternLayoutBase.start(PatternLayoutBase.java:81) at at ch.qos.logback.classic.encoder.PatternLayoutEncoder.start(PatternLayoutEncoder.java:28) at at ch.qos.logback.core.joran.action.NestedComplexPropertyIA.end(NestedComplexPropertyIA.java:167) at at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:317) at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:196) at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:182) at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:149) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:135) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49) at at ch.qos.logback.classic.turbo.ReconfigureOnChangeFilter$ReconfiguringThread.performXMLConfiguration(ReconfigureOnChangeFilter.java:216) at at ch.qos.logback.classic.turbo.ReconfigureOnChangeFilter$ReconfiguringThread.run(ReconfigureOnChangeFilter.java:194) at at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at at java.util.concurrent.FutureTask.run(FutureTask.java:266) at at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.IllegalArgumentException: Illegal char ') at column 91. Only \\, \_, \%, \{, \}, \t, \n, \r combinations are allowed as escape characters. at at ch.qos.logback.core.pattern.util.RegularEscapeUtil.escape(RegularEscapeUtil.java:46) at at ch.qos.logback.core.pattern.parser.TokenStream.escape(TokenStream.java:217) at at ch.qos.logback.core.pattern.parser.TokenStream.handleRightParenthesisState(TokenStream.java:133) at at ch.qos.logback.core.pattern.parser.TokenStream.tokenize(TokenStream.java:97) at at ch.qos.logback.core.pattern.parser.Parser.<init>(Parser.java:72) at ... 19 common frames omitted {code} It seems to me that coloring cannot be performed within an escaped parenthesis block...

    QOS.ch JIRA | 1 year ago | L.Viegas
    ch.qos.logback.core.spi.ScanException: Failed to initialize Parser
  2. 0

    Using this onfiguration file: {code:xml|title=logback.xml} <configuration debug="true" scan="true" scanPeriod="5 seconds"> <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern>%d{HH:mm:ss.SSS} %boldBlue(%-5level) [%yellow(%thread)] %logger{36}\(%blue(%M):%blue(%L)\) - %green(%msg%n)</pattern> </encoder> </appender> <root level="INFO"> <appender-ref ref="CONSOLE"/> </root> </configuration> {code} The following exception is thrown: {code:java} 08:53:23,848 |-ERROR in ch.qos.logback.classic.PatternLayout("%d{HH:mm:ss.SSS} %boldBlue(%-5level) [%yellow(%thread)] %logger{36} \(%blue(%M):%blue(%L)\) - %green(%msg%n)") - Failed to parse pattern "%d{HH:mm:ss.SSS} %boldBlue(%-5level) [%yellow(%thread)] %logger{36} \(%blue(%M):%blue(%L)\) - %green(%msg%n)". ch.qos.logback.core.spi.ScanException: Failed to initialize Parser at ch.qos.logback.core.spi.ScanException: Failed to initialize Parser at at ch.qos.logback.core.pattern.parser.Parser.<init>(Parser.java:74) at at ch.qos.logback.core.pattern.parser.Parser.<init>(Parser.java:66) at at ch.qos.logback.core.pattern.PatternLayoutBase.start(PatternLayoutBase.java:81) at at ch.qos.logback.classic.encoder.PatternLayoutEncoder.start(PatternLayoutEncoder.java:28) at at ch.qos.logback.core.joran.action.NestedComplexPropertyIA.end(NestedComplexPropertyIA.java:167) at at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:317) at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:196) at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:182) at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:149) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:135) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49) at at ch.qos.logback.classic.turbo.ReconfigureOnChangeFilter$ReconfiguringThread.performXMLConfiguration(ReconfigureOnChangeFilter.java:216) at at ch.qos.logback.classic.turbo.ReconfigureOnChangeFilter$ReconfiguringThread.run(ReconfigureOnChangeFilter.java:194) at at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at at java.util.concurrent.FutureTask.run(FutureTask.java:266) at at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.IllegalArgumentException: Illegal char ') at column 91. Only \\, \_, \%, \{, \}, \t, \n, \r combinations are allowed as escape characters. at at ch.qos.logback.core.pattern.util.RegularEscapeUtil.escape(RegularEscapeUtil.java:46) at at ch.qos.logback.core.pattern.parser.TokenStream.escape(TokenStream.java:217) at at ch.qos.logback.core.pattern.parser.TokenStream.handleRightParenthesisState(TokenStream.java:133) at at ch.qos.logback.core.pattern.parser.TokenStream.tokenize(TokenStream.java:97) at at ch.qos.logback.core.pattern.parser.Parser.<init>(Parser.java:72) at ... 19 common frames omitted {code} It seems to me that coloring cannot be performed within an escaped parenthesis block...

    QOS.ch JIRA | 1 year ago | L.Viegas
    ch.qos.logback.core.spi.ScanException: Failed to initialize Parser

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      Illegal char ') at column 91. Only \\, \_, \%, \{, \}, \t, \n, \r combinations are allowed as escape characters.

      at ch.qos.logback.core.pattern.util.RegularEscapeUtil.escape()
    2. Logback Core Module
      PatternLayoutBase.start
      1. ch.qos.logback.core.pattern.util.RegularEscapeUtil.escape(RegularEscapeUtil.java:46)
      2. ch.qos.logback.core.pattern.parser.TokenStream.escape(TokenStream.java:217)
      3. ch.qos.logback.core.pattern.parser.TokenStream.handleRightParenthesisState(TokenStream.java:133)
      4. ch.qos.logback.core.pattern.parser.TokenStream.tokenize(TokenStream.java:97)
      5. ch.qos.logback.core.pattern.parser.Parser.<init>(Parser.java:72)
      6. ch.qos.logback.core.pattern.parser.Parser.<init>(Parser.java:66)
      7. ch.qos.logback.core.pattern.PatternLayoutBase.start(PatternLayoutBase.java:81)
      7 frames
    3. Logback Classic Module
      PatternLayoutEncoder.start
      1. ch.qos.logback.classic.encoder.PatternLayoutEncoder.start(PatternLayoutEncoder.java:28)
      1 frame
    4. Logback Core Module
      GenericConfigurator.doConfigure
      1. ch.qos.logback.core.joran.action.NestedComplexPropertyIA.end(NestedComplexPropertyIA.java:167)
      2. ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:317)
      3. ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:196)
      4. ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:182)
      5. ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62)
      6. ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:149)
      7. ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:135)
      8. ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99)
      9. ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49)
      9 frames
    5. Logback Classic Module
      ReconfigureOnChangeFilter$ReconfiguringThread.run
      1. ch.qos.logback.classic.turbo.ReconfigureOnChangeFilter$ReconfiguringThread.performXMLConfiguration(ReconfigureOnChangeFilter.java:216)
      2. ch.qos.logback.classic.turbo.ReconfigureOnChangeFilter$ReconfiguringThread.run(ReconfigureOnChangeFilter.java:194)
      2 frames
    6. Java RT
      Thread.run
      1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      2. java.util.concurrent.FutureTask.run(FutureTask.java:266)
      3. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      4. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      5. java.lang.Thread.run(Thread.java:745)
      5 frames