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

NullPointerException when filtering stack trace in %replace

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 1.1.3
    • None

    Description

      Trying filtering out stack traces feature introduced in 1.1.3. In general it works fine, but find out that it doesn't work much for our case, i.e. we use %replace to flatter stack trace, and expression like:

      %replace(%ex{full, org.springframework}){'\n', '|||'}%nopex

      leads to null pointer exception:

      11:18:31,018 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@47:19 - RuntimeException in Action for tag [encoder] java.lang.NullPointerException
      	at java.lang.NullPointerException
      	at 	at ch.qos.logback.classic.pattern.ThrowableProxyConverter.start(ThrowableProxyConverter.java:75)
      	at 	at ch.qos.logback.core.pattern.ConverterUtil.startConverters(ConverterUtil.java:37)
      	at 	at ch.qos.logback.core.pattern.ConverterUtil.startConverters(ConverterUtil.java:33)
      	at 	at ch.qos.logback.core.pattern.PatternLayoutBase.start(PatternLayoutBase.java:91)
      	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.util.ContextInitializer.configureByResource(ContextInitializer.java:77)
      	at 	at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:119)
      

      However following expression works fine:

      %replace(%ex{full}){'\n', '|||'}%nopex

      Attachments

        Activity

          People

            logback-dev Logback dev list
            redron Andriy Tkach
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: