Why EAP6 is not able to parse the system properties in logging formatter via CLI ?

Solution Verified - Updated -

Issue

  • While using a "system-property" in the "logging-output" via the "jboss-cli.sh" script as following it succeeds only when "${" occurs only once in the String value.

Example-1: Working Scenario.

cd /subsystem=logging/periodic-rotating-file-handler=FILE
:write-attribute(name=formatter, value="${jboss.node.name} %d{HH:mm:ss,SSS} %-5p [%c] (${jboss.node.name} %t) %s%E%n")

{"outcome" => "success"}

Example-2: Non-Working Scenario.

cd /subsystem=logging/periodic-rotating-file-handler=FILE
:write-attribute(name=formatter, value="%d{HH:mm:ss,SSS} %-5p [%c] (${jboss.node.name} %t) %s%E%n")
{
    "outcome" => "failed",
    "failure-description" => "JBAS014749: Operation handler failed: String index out of range: -15",
    "rolled-back" => true
}
  • Since expressions are allowed in formatter, It is ideally expected that users can use "system-properties" everywhere in the "formatting-string".

  • Why does it fail in EAP 6.2 ?


When I attach jconsole to the app server with the following configured for jboss logging

I get "java.lang.StringIndexOutOfBoundsException: String index out of range: -9"

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.2

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.