Logging Exceptions within ESB

Solution Verified - Updated -

Environment

JBoss Service Oriented Architecture Platform (SOA-P) 5.0.2

Issue

Configure an ESB in such a way that it will throw an exception from one of the actions. The following is an example I have used to experiment with exception handling:

public Message process(Message message) throws Exception {
logger.info("BANG");

throw new Exception("BANG");
}

We want to capture all exceptions and log them. In our custom actions this may not be a problem - we can catch and rethrow, but the standard actions, like XSLT transform will be left out. For example if an exception is thrown during an XSLT transform, we would like to log this exception.

How can we log any exception thrown?

Resolution

To get the logging working we added a line to the log4j configuration to log a DEBUG like so:

<category name="org.jboss.soa.esb.listeners.message.ActionProcessingPipeline">
<priority value="DEBUG"/>
</category>

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.