[jboss-jira] [JBoss JIRA] (WFCORE-3891) Cannot create xml-formatter and json-formatter with the same name as existing resources in logging subsystem

Nikoleta Žiaková (JIRA) issues at jboss.org
Mon May 28 02:28:00 EDT 2018


    [ https://issues.jboss.org/browse/WFCORE-3891?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13582638#comment-13582638 ] 

Nikoleta Žiaková commented on WFCORE-3891:
------------------------------------------

[~jamezp] thank you for the explanation, I did not realize! This behaviour is hidden when using CLI - {{file}} is the only mandatory attribute for file-handler, default (pattern) formatter is used when left undefined. In the CLI, you don't see the created {{test}} pattern-formatter, which is why I consider the inability to create a different formatter with name {{test}} a bug from UX perspective. WDYT?

{code}
[standalone at localhost:9990  /] /subsystem=logging/file-handler=test:add(file={path=test.log})
{"outcome" => "success"}
[standalone at localhost:9990  /] /subsystem=logging:read-resource
{
    "outcome" => "success",
    "result" => {
        "add-logging-api-dependencies" => true,
        "use-deployment-logging-config" => true,
        "async-handler" => undefined,
        "console-handler" => {"CONSOLE" => undefined},
        "custom-formatter" => undefined,
        "custom-handler" => undefined,
        "file-handler" => {"test" => undefined},
        "json-formatter" => undefined,
        "log-file" => {"server.log" => undefined},
        "logger" => {
            "com.arjuna" => undefined,
            "org.jboss.as.config" => undefined,
            "sun.rmi" => undefined
        },
        "logging-profile" => undefined,
        "pattern-formatter" => {
            "PATTERN" => undefined,
            "COLOR-PATTERN" => undefined
        },
        "periodic-rotating-file-handler" => {"FILE" => undefined},
        "periodic-size-rotating-file-handler" => undefined,
        "root-logger" => {"ROOT" => undefined},
        "size-rotating-file-handler" => undefined,
        "syslog-handler" => undefined,
        "xml-formatter" => undefined
    }
}
{code}

> Cannot create xml-formatter and json-formatter with the same name as existing resources in logging subsystem
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: WFCORE-3891
>                 URL: https://issues.jboss.org/browse/WFCORE-3891
>             Project: WildFly Core
>          Issue Type: Bug
>          Components: Logging
>            Reporter: Nikoleta Žiaková
>            Assignee: James Perkins
>
> When trying to create an {{xml-formatter}} or {{json-formatter}} with the same name as another resource (e.g. a {{file-handler}}), the operation fails:
> {code}
> [standalone at localhost:9990  /] /subsystem=logging/file-handler=test:add(file={path=aaa.log})
> {"outcome" => "success"}
> [standalone at localhost:9990  /] /subsystem=logging/xml-formatter=test:add
> {
>     "outcome" => "failed",
>     "failure-description" => "WFLYCTL0158: Operation handler failed: java.lang.IllegalArgumentException: No property \"dateFormat\" setter found for formatter \"test\"",
>     "rolled-back" => true
> }
> {code}
> Similarly vice-versa, when trying to create another resource in logging subsystem with the same name as an {{xml-formatter}} or a {{json-formatter}}, the operation fails:
> {code}
> [standalone at localhost:9990  /] /subsystem=logging/json-formatter=test:add
> {"outcome" => "success"}
> [standalone at localhost:9990  /] /subsystem=logging/file-handler=test:add(file={path=test.log})
> {
>     "outcome" => "failed",
>     "failure-description" => "WFLYCTL0158: Operation handler failed: java.lang.IllegalArgumentException: No property \"pattern\" setter found for formatter \"test\"",
>     "rolled-back" => true
> }
> {code}
> The same scenario works for e.g. {{pattern-formatter}}:
> {code}
> [standalone at localhost:9990  /] /subsystem=logging/file-handler=test:add(file={path=test.log})
> {"outcome" => "success"}
> [standalone at localhost:9990  /] /subsystem=logging/pattern-formatter=test:add
> {"outcome" => "success"}
> {code}



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)



More information about the jboss-jira mailing list