[jboss-as7-dev] Listen to all JBoss logging messages

James Perkins jperkins at redhat.com
Mon Aug 29 17:51:05 EDT 2011


As Brian points out you can use a custom handler. You can attach it to 
the root logger, but it will only log messages that meet the root-logger 
level.

For example if you want to see all messages debug and higher in a 
separate file you could do something like this:

<subsystem>
             ...
<custom-handler name="debugFileHandler" 
class="org.jboss.logmanager.handlers.FileHandler" 
module="org.jboss.logmanager">
<level name="DEBUG"/>
<properties>
<property name="file" value="/home/user/debug.log"/>
<property name="autoFlush" value="true"/>
</properties>
</custom-handler>
<root-logger>
<level name="ALL"/>
<handlers>
<handler name="CONSOLE"/>
<handler name="FILE"/>
<handler name="debugFileHandler"/>
</handlers>
</root-logger>
             ...
</subsystem>

On 08/26/2011 04:05 AM, David Bosschaert wrote:
> Hi all,
>
> For a test case I'm looking for a way to simply listen to all the log
> messages sent through JBoss logging. Is there a way to do this?
>
> Thanks,
>
> David
> _______________________________________________
> jboss-as7-dev mailing list
> jboss-as7-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev

-- 
James R. Perkins
JBoss by Red Hat



More information about the jboss-as7-dev mailing list