我正在尝试使用tutorial向JBoss企业应用程序平台 - 版本6.1.0.GA添加自定义日志处理程序。但是,当我将我的模块添加到joboss模块,并更新自定义日志处理程序的standalone.xml然后启动jboss时,它会崩溃.Below是自定义日志module.xml和standalone.xml配置。在standalone.xml中,我的自定义处理程序在自定义处理程序标记下配置。
module.xml
<module xmlns="urn:jboss:module:1.1" name="siteelf.loggers">
<resources>
<resource-root path="SiteElfCustomLogger.jar"/>
<!-- Insert resources here -->
</resources>
<dependencies>
<module name="org.jboss.logging"/>
<module name="javax.api"/>
</dependencies>
</module>
standalone.xml
<subsystem xmlns="urn:jboss:domain:logging:1.2">
<console-handler name="CONSOLE">
<level name="ALL"/>
<encoding value="UTF-8"/>
<formatter>
<pattern-formatter pattern="%d{dd MMM HH:mm:ss} %-5p -- %s%E%n"/>
</formatter>
</console-handler>
<periodic-rotating-file-handler autoflush="true" name="FILE">
<level name="ALL"/>
<encoding value="UTF-8"/>
<formatter>
<pattern-formatter pattern="%d{dd MMM HH:mm:ss} %-5p -- %s%E%n"/>
</formatter>
<file path="server.log" relative-to="jboss.server.log.dir"/>
<suffix value=".yyyy-MM-dd"/>
<append value="true"/>
</periodic-rotating-file-handler>
<custom-handler class="com.org.siteelf.core.log.SiteElfMainLogger" module="siteelf.loggers" name="CustomLogger">
<level name="ERROR"/>
<formatter>
<pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
</formatter>
<file path="server.log" relative-to="jboss.server.log.dir"/>
<properties>
<property name="logFile" value="/usr/share/jboss7/standalone/log/server.log"/>
<property name="debugMode" value="true"/>
</properties>
</custom-handler>
<logger category="com.arjuna">
<level name="OFF"/>
</logger>
<logger category="org.apache.tomcat.util.modeler">
<level name="OFF"/>
</logger>
<logger category="org.jboss.as.config">
<level name="INFO"/>
</logger>
<logger category="sun.rmi">
<level name="INFO"/>
</logger>
<logger category="jacorb">
<level name="OFF"/>
</logger>
<logger category="jacorb.config">
<level name="OFF"/>
</logger>
<root-logger>
<level name="ALL"/>
<handlers>
<handler name="CONSOLE"/>
<handler name="FILE"/>
</handlers>
</root-logger>
</subsystem>