Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1465941

Summary: (6.4.z) Inconsistency of formatter and named-formatter in console logging handler
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Jiri Ondrusek <jondruse>
Component: Domain ManagementAssignee: Jiri Ondrusek <jondruse>
Status: CLOSED EOL QA Contact: Pavel Slavicek <pslavice>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.4.16CC: bmaxwell, brian.stansberry, dandread
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-19 12:48:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jiri Ondrusek 2017-06-28 13:42:16 UTC
Description of problem:

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 EAP 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"
    }
}


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. %WILDFLY_HOME/bin/standalone.sh
2. %WILDFLY_HOME/bin/jboss-cli.sh --connect
3. Print COLOR-PATTERN pattern-formatter
[standalone@localhost:9990 /] /subsystem=logging/pattern-formatter=COLOR-PATTERN:read-attribute(name=pattern)
{
    "outcome" => "success",
    "result" => "%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"
}
4. Print CONSOLE console-handler
[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"
    }
}

Actual results:


Expected results:


Additional info:
See upstream issues for more information.