版本:jboss-eap-7.2.4
这是用于日志记录的standalone.xml 配置部分,基本上有两个大小的旋转文件处理程序作为异步处理程序的子处理程序。
<subsystem xmlns="urn:jboss:domain:logging:6.0">
<async-handler name="ASYNC">
<queue-length value="8192"/>
<overflow-action value="block"/>
<subhandlers>
<handler name="FILE"/>
<handler name="MetricLogger"/>
</subhandlers>
</async-handler>
<size-rotating-file-handler name="FILE" autoflush="true">
<filter-spec value="not(match("application-metrics.*"))"/>
<formatter>
<pattern-formatter pattern="%d{dd MMM yyyy HH:mm:ss,SSS} %5p [CMS] [%t] %C{1}.%M() - %m%n"/>
</formatter>
<file path="/opt/application/log/application.log"/>
<rotate-size value="10m"/>
<max-backup-index value="100"/>
<append value="true"/>
</size-rotating-file-handler>
<size-rotating-file-handler name="MetricLogger" autoflush="true">
<filter-spec value="all(match("application-metrics.*"))"/>
<formatter>
<pattern-formatter pattern="%d{dd MMM yyyy HH:mm:ss,SSS} %5p [METRICS] - %m%n"/>
</formatter>
<file path="/opt/application/log/application-metrics.log"/>
<rotate-size value="10m"/>
<max-backup-index value="10"/>
<append value="true"/>
</size-rotating-file-handler>
一开始它可以成功运行,并且可以将日志打印到文件中,但是运行一段时间后,它会抛出异常并且jboss会退出......
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.logmanager.config.AbstractPropertyConfiguration$1.rollback(AbstractPropertyConfiguration.java:244)
at org.jboss.logmanager.config.LogContextConfigurationImpl.doForget(LogContextConfigurationImpl.java:355)
at org.jboss.logmanager.config.LogContextConfigurationImpl.forget(LogContextConfigurationImpl.java:319)
at org.jboss.as.logging.logmanager.ConfigurationPersistence.forget(ConfigurationPersistence.java:341)
at org.jboss.as.logging.logmanager.ConfigurationPersistence.rollback(ConfigurationPersistence.java:349)
at org.jboss.as.logging.LoggingOperations$CommitOperationStepHandler$1.handleResult(LoggingOperations.java:122)
at org.jboss.as.controller.AbstractOperationContext$Step.invokeResultHandler(AbstractOperationContext.java:1533)
at org.jboss.as.controller.AbstractOperationContext$Step.handleResult(AbstractOperationContext.java:1515)
at org.jboss.as.controller.AbstractOperationContext$Step.finalizeInternal(AbstractOperationContext.java:1472)
at org.jboss.as.controller.AbstractOperationContext$Step.finalizeStep(AbstractOperationContext.java:1455)
at org.jboss.as.controller.AbstractOperationContext$Step.access$400(AbstractOperationContext.java:1319)
at org.jboss.as.controller.AbstractOperationContext.executeResultHandlerPhase(AbstractOperationContext.java:876)
at org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:726)
at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:467)
at org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1411)
at org.jboss.as.controller.ModelControllerImpl.boot(ModelControllerImpl.java:521)
at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:470)
at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:432)
at org.jboss.as.server.ServerService.boot(ServerService.java:427)
at org.jboss.as.server.ServerService.boot(ServerService.java:386)
at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:372)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException: overflowAction is null
at org.jboss.logmanager.handlers.AsyncHandler.setOverflowAction(AsyncHandler.java:117)
... 26 more No property "queueLength" type could be determined for handler "ASYNC"