1 Reply Latest reply on Aug 18, 2009 9:46 AM by Francesco Marchioni

    Enable logging for requests, responses

    Marcus Dahlstein Newbie

      Hi,

      we have an issue with our server where it seems to only send partial responses at times, non at all sometiems and otherwise working as intended.
      I have tried using tcpdump to get a picture of what is going in/out from the server but I would like to get a mored detailed picture of what the server is doing.

      There is no logging in our applictation for these methods which fails, so what I would like to do is enable logging on the JBoss/tomcat for all incoming and outgoing traffic.

      Is there a way of doing this? My skills in log4j is unfortunatly not the best..
      Any help would be much appriciated.

      Regards
      Marcus

        • 1. Re: Enable logging for requests, responses
          Francesco Marchioni Apprentice

          At tomcat level, you can have a dump of the request and an access log as well by uncommenting the following Valves into server.xml

          <Valve className="org.apache.catalina.valves.RequestDumperValve" />
          
          
          
           <Valve className="org.apache.catalina.valves.AccessLogValve"
           prefix="localhost_access_log." suffix=".log"
           pattern="common" directory="${jboss.server.log.dir}"
           resolveHosts="false" />


          As for the response I guess you might programmatically dump both request and response using a Servlet filter....

          hope it helps
          Francesco