[jboss-jira] [JBoss JIRA] (WFCORE-1718) Handlers within Audit Logger are not removed properly when Audit Logger is removed
Brian Stansberry (JIRA)
issues at jboss.org
Wed Aug 17 16:14:00 EDT 2016
[ https://issues.jboss.org/browse/WFCORE-1718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13280453#comment-13280453 ]
Brian Stansberry commented on WFCORE-1718:
------------------------------------------
This can be fixed by having AuditLogLoggerRemoveHandler extend AbstractRemoveStepHandler.
However, as part of doing this we need to review the use of AuditLogLoggerResourceDefinition.createHostServerDefinition. The only use I see of that, the same auditLogger instance is passed to it as is passed to AuditLogLoggerResourceDefinition.createDefinition. So the same logger gets passed to two resources, in one case with 'executeRuntime=true' and another time with 'executeRuntime=false'. In both cases the add handler performs at least some sort of modification of the auditLogger, with executeRuntime controlling exactly what. And in both cases the remove handler is modifying the audit logger. This just seems a bit odd. Intuitively I'd think the AuditLogLoggerResourceDefinition.createHostServerDefinition would not involve any runtime modification at all as the resource is just storing config data on the HC for its use in configuring a server.
> Handlers within Audit Logger are not removed properly when Audit Logger is removed
> ----------------------------------------------------------------------------------
>
> Key: WFCORE-1718
> URL: https://issues.jboss.org/browse/WFCORE-1718
> Project: WildFly Core
> Issue Type: Bug
> Components: Domain Management
> Affects Versions: 3.0.0.Alpha5
> Reporter: Jan Tymel
> Assignee: Brian Stansberry
>
> If Audit Logger is removed, destination handlers (i.e. its child nodes) are not removed properly. They are not present in the config file. They seem to be not removed "internally" though. This leads to a couple of issues:
> 1. It is not possible to remove referenced File/Syslog handlers. If user tries to remove them the _NullPointerException_ is given as a result. Try following commands:
> {{/core-service=management/access=audit/file-handler=file:remove()}}
> {{/core-service=management/access=audit/syslog-handler=my-syslog-handler:remove()}}
> Their output is:
> {code}
> {
> "outcome" => "failed",
> "failure-description" => "WFLYCTL0158: Operation handler failed: java.lang.NullPointerException",
> "rolled-back" => true
> }
> {code}
> 2. AuditLog continues to send auditable events to previously referenced File/Syslog handlers.
> * Create auditable event (e.g. {{/subsystem=logging/logger=com.arjuna:write-attribute(name=level,value=DEBUG)}})
> * See log in the file (WILDFLY_HOME/standalone/data/audit-log.log)
> * See log in the syslog (/var/log/messages)
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jboss-jira
mailing list