[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

JBOSS/Log4J configuration

Posted on 2008-01-27
5
Medium Priority
?
1,948 Views
Last Modified: 2013-12-25
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

0
Comment
Question by:unifi
  • 3
  • 2
5 Comments
 
LVL 19

Expert Comment

by:ramazanyich
ID: 20754266
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
 

Author Comment

by:unifi
ID: 20754351
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
 
LVL 19

Expert Comment

by:ramazanyich
ID: 20754626
what do you mean by complete xml request/response ? is it a HTTP request/response  ? WebService call ?
0
 

Author Comment

by:unifi
ID: 20755147
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
 
LVL 19

Accepted Solution

by:
ramazanyich earned 2000 total points
ID: 20757588
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

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Convert websphere application server default chained Certificates from 1024 to 2048 keysize or higher size and also you can change signatureAlgorithm . Please make sure Websphere Application Server fixpack 7.0.0.23 or Above. The following steps a…
In a question here at Experts Exchange, a member was looking for "a little app that would allow sound to be turned OFF and ON by simply clicking on an icon in the system tray". This article shows how to achieve that, as well as providing the same OF…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses

611 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question