]
Yeray Borges resolved WFCORE-3949.
----------------------------------
Resolution: Rejected
Changed the resolution to "rejected" because really it is not a bug. It is an
invalid configuration, as per Brian's comments looks like it is not worth the effort
of developing a better way to handle it.
Cannot use server-file audit logger handler in JMX audit logging
-----------------------------------------------------------------
Key: WFCORE-3949
URL:
https://issues.jboss.org/browse/WFCORE-3949
Project: WildFly Core
Issue Type: Bug
Components: JMX, Logging
Reporter: Yeray Borges
Assignee: Yeray Borges
When we are working in domain mode, we can register two kinds of audit logger handlers
into JMX audit logging.
Those predefined handlers are {{host-file}} handler, which has a log file relative to
{{jboss.domain.data.dir}}, and {{server-file}} handler, which has a log file relative to
{{jboss.server.data.dir}}.
When we try to register {{server-file}} handler into JMX audit logging, its relative path
cannot be resolved and when a log entry is written, we can see the following error log:
{code:java}
ERROR [org.jboss.as.controller.management-operation] (MSC service thread 1-1)
WFLYCTL0037: Update of the management operation audit log failed in handler
'server-file': java.lang.IllegalArgumentException: WFLYCTL0256: Could not find a
path called 'jboss.server.data.dir'
[Host Controller] at
org.jboss.as.controller.services.path.PathManagerService.resolveRelativePathEntry(PathManagerService.java:110)
[Host Controller] at
org.jboss.as.controller.audit.AbstractFileAuditLogHandler.initialize(AbstractFileAuditLogHandler.java:62)
[Host Controller] at
org.jboss.as.controller.audit.AuditLogHandler.writeLogItem(AuditLogHandler.java:82)
[Host Controller] at
org.jboss.as.controller.audit.ManagedAuditLoggerImpl.writeLogItem(ManagedAuditLoggerImpl.java:266)
[Host Controller] at
org.jboss.as.controller.audit.ManagedAuditLoggerImpl.storeLogItem(ManagedAuditLoggerImpl.java:248)
[Host Controller] at
org.jboss.as.controller.audit.ManagedAuditLoggerImpl.logJmxMethodAccess(ManagedAuditLoggerImpl.java:122)
[Host Controller] at
org.jboss.as.jmx.PluggableMBeanServerImpl$LogAction.doLog(PluggableMBeanServerImpl.java:1281)
[Host Controller] at
org.jboss.as.jmx.PluggableMBeanServerImpl.log(PluggableMBeanServerImpl.java:1184)
[Host Controller] at
org.jboss.as.jmx.MBeanServerAuditLogRecordFormatter.log(MBeanServerAuditLogRecordFormatter.java:331)
[Host Controller] at
org.jboss.as.jmx.MBeanServerAuditLogRecordFormatter.registerMBean(MBeanServerAuditLogRecordFormatter.java:147)
[Host Controller] at
org.jboss.as.jmx.PluggableMBeanServerImpl.registerMBean(PluggableMBeanServerImpl.java:880)
[Host Controller] at
org.jboss.threads.EnhancedQueueExecutor$1.run(EnhancedQueueExecutor.java:385)
[Host Controller] at
org.jboss.threads.EnhancedQueueExecutor$1.run(EnhancedQueueExecutor.java:379)
[Host Controller] at java.security.AccessController.doPrivileged(Native Method)
[Host Controller] at
org.jboss.threads.EnhancedQueueExecutor.<init>(EnhancedQueueExecutor.java:379)
[Host Controller] at
org.jboss.threads.EnhancedQueueExecutor$Builder.build(EnhancedQueueExecutor.java:671)
[Host Controller] at
org.jboss.as.controller.remote.AbstractModelControllerOperationHandlerFactoryService.start(AbstractModelControllerOperationHandlerFactoryService.java:112)
[Host Controller] at
org.jboss.as.host.controller.mgmt.MasterDomainControllerOperationHandlerService.start(MasterDomainControllerOperationHandlerService.java:90)
[Host Controller] at
org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1736)
[Host Controller] at
org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1698)
[Host Controller] at
org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1556)
[Host Controller] at
org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
[Host Controller] at
org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
[Host Controller] at
org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
[Host Controller] at
org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
[Host Controller] at java.lang.Thread.run(Thread.java:748)
{code}
Registering a {{host-file}} does not throw any errors and work as expected. Althought
there is a capability reference to jboss.server.data.dir in HostPathManagerService, when
the handler is registered for JMX, jboss.server.data.dir cannot be resolved.