]
James Perkins commented on WFCORE-37:
-------------------------------------
The easiest workaround for this is to just add the handler in the {{add}} operation. The
issue is how the operations are processed. The model is first updated which because the
the {{add-handler}} operation adds the handler to the model. Then the runtime is updated
and during the add of the logger, the handler is assigned to the logger because it's
in the model. This results in the {{add-handler}} failing as the {{add}} operation for the
{{root-logger=ROOT}} resource already added the runtime change for the handler.
Batching logging profile creation CLI commands can cause errors
---------------------------------------------------------------
Key: WFCORE-37
URL:
https://issues.jboss.org/browse/WFCORE-37
Project: WildFly Core
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Logging
Reporter: Kyle Lape
Assignee: James Perkins
Given these set of commands:
{noformat}
/subsystem=logging/logging-profile=myLoggingProfile:add
/subsystem=logging/logging-profile=myLoggingProfile/file-handler=myHandler:add(level=ALL,file={"relative-to"
=> "jboss.server.log.dir","path" => "myapp.log"})
/subsystem=logging/logging-profile=myLoggingProfile/root-logger=ROOT:add
/subsystem=logging/logging-profile=myLoggingProfile/root-logger=ROOT:add-handler(name=myHandler)
/subsystem=logging/logging-profile=myLoggingProfile/root-logger=ROOT:change-root-log-level(level=INFO)
{noformat}
If I run those in a batch, I get an error:
{noformat}13:32:52,478 ERROR [org.jboss.as.controller.management-operation]
(management-handler-thread - 4) JBAS014613: Operation ("add-handler") failed -
address: ([
("subsystem" => "logging"),
("logging-profile" => "myLoggingProfile"),
("root-logger" => "ROOT")
]) - failure description: "JBAS011536: Handler myHandler is already assigned."
{noformat}
If I run each one individually, I get no error.