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

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

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.3
    • Fix Version/s: None
    • Component/s: logback-core
    • Labels:
      None
    • Environment:

      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

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

              Dates

              • Created:
                Updated: