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

Bad parsing of pattern containing ')' with use property

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • logback-classic
    • None
    • Operating System: All
      Platform: All

    Description

      The following config works fine:

      <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
      <encoder>
      <pattern>(%file)</pattern>
      </encoder>
      </appender>

      If I use property to define pattern, so it isn't work:

      <property name="PATTERN" value="(%file)" />
      <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
      <encoder>
      <pattern>${PATTERN}</pattern>
      </encoder>
      </appender>

      I must use "
      )" instead ")", then following config work fine:

      <property name="PATTERN" value="\\(%file
      )" />
      <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
      <encoder>
      <pattern>${PATTERN}</pattern>
      </encoder>
      </appender>

      Attachments

        Activity

          People

            logback-dev Logback dev list
            janvalta Jan Valta
            Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: