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

Message replace won't work when checking a regex text inside another exception

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 1.2.3
    • logback-core
    • None
    • Windows 10

      Spring boot  2.1.3 

      Spring ingegration 5.1.3

    Description

      Hello,

      I am trying to mask a token in the logs, and in order to do so i am using this pattern :

      <pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}] - ${PID:-????} %5p [%t] --- %c{1}: %replace(%msg){'Bearer\s[0-9a-zA-Z_\.\n\r-]{798}','***'}%n</pattern>
      

      This pattern works well but when said token is to be found inside another exception (nested). In that case the regex expression fails to replace it.

      This happens to me in the class MessagePublishingErrorHandler of spring integration when printing a stacktrace that at the bottom contains the message with the header.

      Could you please have a look at that?
      Thanks

      Attachments

        Activity

          People

            logback-dev Logback dev list
            miticopalla Oscar Palladino
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: