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

When encoder pattern set as a variable then logback skips newline %n

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 1.2.3
    • logback-core
    • None
    • Linux

    Description

      I have following logback.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <configuration>
        <include resource="org/springframework/boot/logging/logback/defaults.xml"/>
        <property scope="context" name="pattern" value="%d{yyyy-MM-dd'T'HH:mm:ss.SSS'Z', UTC} ${LOG_LEVEL_PATTERN:-%5p} %logger [%t] \(%X{trace}\) %X{loggingMessageExtender}: %m%n" />
        <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
          <encoder>
            <Pattern>${pattern}</Pattern>
          </encoder>
        </appender>
        <root level="INFO">
          <appender-ref ref="CONSOLE"/>
        </root>
      </configuration>
      

      Then all log statements are written in the single line even given than the pattern have %n in the end

      Attachments

        Activity

          People

            logback-dev Logback dev list
            stokito Sergey Ponomarev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: