Jboss记录器验证
如何在standalone.xml中配置logger,以便只为一个类或包编写消息 例如:Jboss记录器验证,jboss,jboss7.x,Jboss,Jboss7.x,如何在standalone.xml中配置logger,以便只为一个类或包编写消息 例如: 17:56:41 ERROR [com.google.test] (http-/0.0.0.0:8080-5) Test message Google 17:56:41 ERROR [com.yaahoo.test] (http-/0.0.0.0:8080-5) Test message Yaahoo 我只想为com.google.test类选择消息 我的处理器坏了 <periodic-rotat
17:56:41 ERROR [com.google.test] (http-/0.0.0.0:8080-5) Test message Google
17:56:41 ERROR [com.yaahoo.test] (http-/0.0.0.0:8080-5) Test message Yaahoo
我只想为com.google.test类选择消息
我的处理器坏了
<periodic-rotating-file-handler name="FILE" autoflush="true">
<level name="ERROR"/>
<filter-spec value="any(match("[com.google.test]*"))"/>
<formatter>
<named-formatter name="PATTERN"/>
</formatter>
<file relative-to="jboss.server.base.dir" path="Error.log"/>
<suffix value=".yyyy-MM-dd"/>
</periodic-rotating-file-handler>
您可能需要在该配置中添加一个
部分
比如
<subsystem xmlns="urn:jboss:domain:logging:1.1">
<logger category="com.google.test">
<level name="ERROR"/>
</logger>
您已经定义了文件处理程序,但还没有定义记录器,是吗?您应该在独立xml中添加记录器:
<logger category="com.google.test" use-parent-handlers="false">
<level name="ERROR"/>
<handlers>
<handler name="FILE"/>
</handlers>
</logger>
还要查一下官员