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

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

    XMLWordPrintable

    Details

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

      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

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

              Dates

              Created:
              Updated: