Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-2011

Inconsistency of formatter and named-formatter in console logging handler

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Minor Minor
    • None
    • 3.0.0.Alpha13
    • Management

      In logging subsystem the default CONSOLE console-handler is defined with COLOR-PATTERN named-formatter.
      And the COLOR-PATTERN named-formatter is defined with:

      "%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"

      It is working as it is defined with colors in a console.

      standalone.xml
      ...
      <subsystem xmlns="urn:jboss:domain:logging:3.0">
          <console-handler name="CONSOLE">
              <level name="INFO"/>
              <formatter>
                  <named-formatter name="COLOR-PATTERN"/>
              </formatter>
          </console-handler>
      ...
          <formatter name="COLOR-PATTERN">
              <pattern-formatter pattern="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
          </formatter>
      </subsystem>
      ...
      

      However there is a inconsistency in the CLI and WildFly admin console views.

      In the CLI, CONSOLE formatter is:

      "%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"

      It is wrong and different with the working logging format in a console.

      JBoss CLI
      [standalone@localhost:9990 /] /subsystem=logging/console-handler=CONSOLE:read-resource
      {
          "outcome" => "success",
          "result" => {
              "autoflush" => true,
              "enabled" => true,
              "encoding" => undefined,
              "filter" => undefined,
              "filter-spec" => undefined,
              "formatter" => "%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n",
              "level" => "INFO",
              "name" => "CONSOLE",
              "named-formatter" => "COLOR-PATTERN",
              "target" => "System.out"
          }
      }
      

      It should be fixed like below:

      Expected result
      [standalone@localhost:9990 /] /subsystem=logging/console-handler=CONSOLE:read-resource
      {
          "outcome" => "success",
          "result" => {
              "autoflush" => true,
              "enabled" => true,
              "encoding" => undefined,
              "filter" => undefined,
              "filter-spec" => undefined,
              "formatter" => undefined,
              "level" => "INFO",
              "name" => "CONSOLE",
              "named-formatter" => "COLOR-PATTERN",
              "target" => "System.out"
          }
      }
      

              rhn-support-jwon Ted Won
              rhn-support-jwon Ted Won
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: