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

Carriage return in PatternLayout in the XML configuration file

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • logback-core
    • None
    • Windows XP but probably all platforms

    Description

      Hi,

      I used to use the text formatting for the XML files in Eclipse, but sometimes the PatterLayout is too long, and the formatter divides it in two lines.

      — BEFORE FORMAT —
      <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
      <pattern> %date

      {ISO8601} [%thread] %-5level %logger{35} - %message%n </pattern>
      </encoder>

      — AFTER FORMAT —
      <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
      <pattern> %date{ISO8601}

      [%thread] %-5level %logger

      {35}

      -
      %message%n </pattern>
      </encoder>

      Then, the output in the ConsoleAppender will have two lines for each message logged.
      I think, the configuration reader has to ignore the carriage return in the file (in the middle of the patterLayout) and just only consider the %n.

      Thanks.
      Best regards

      Andrés Gómez Casanova

      Attachments

        Activity

          People

            logback-dev Logback dev list
            angoca Andres Gomez Casanova
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: