JBOSS/Log4J configuration

Hi,

Is there a way to configure JBoss or Log4J to capture the complete XML request and response data for transactions? If there is a way to match up the response to its request that would be great but if not I'd be fine  with pouring though log files to match them up manually.

Thanks,
Ed

unifiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ramazanyichCommented:
The simplest way is to add Thread info to the log4j debug line.
There is a ConversionPattern parameter in jboss log4j xml file.
default value is normally <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>

But if you do change it to
<param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>

then it log4j will put also thread name and NDC for each logged line.
After that you can trace the logging per thread which is normally correspondes to one request/responce cycle
0
unifiAuthor Commented:
Hi,

Thanks for the quick response. I tried changing the conversionPattern parameter as you suggested but am not seeing the request and response XMLs in the log file. I am able to trace the log entries for the request and response but what I am looking to capture is a complete depiction of the XML messages themselves. Is there a log4j configuration that will dump this data to the log file for debugging puposes?

Thanks
0
ramazanyichCommented:
what do you mean by complete xml request/response ? is it a HTTP request/response  ? WebService call ?
0
unifiAuthor Commented:
It is a web service call through a relatively black box client API. So, I am not entirely sure what the request or response messages look like from the client side. I know that the API builds an XML request to send to JBoss and receives an XML in response in return. So, what I am essentially trying to do is to intercept these messages at the AppServer layer.

Thanks
0
ramazanyichCommented:
If you are using jboss4.2.x then in jboss-log4j.xml file put following lines:

 <category name="org.jboss.ws.core.MessageTrace">
    <priority value="TRACE"/>
   </category>


if jboss-4.0.x then in log4j.xml add following lines:

<category name="jbossws.SOAPMessage">
    <priority value="TRACE"/>
   </category>

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.