Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

To enable http level request/response logs in Application Server (AS), we can use the Access_Log_Valve which is provided in Tomcat 7. For more information, please go to http://tomcat.apache.org/tomcat-7.0-doc/config/valve.html#Access_Log_Valve.

To enable logging, you have to put the following XML element under  /Server/Service/Engine/Host/ in  {WSO2AS_HOME}/repository/conf/tomcat/catalina-server.xml and restart the AS server.

...

When we send the following http request:

GET http://<IP>:<PORT>/example/servlets/servlet/RequestInfoExample?abc=xyz 

we can see the following log entry in the localhost_access_log_sample.{DATE}.log file.

...

Now, when we send following POST request with URL encoded values param1=value1 and param2=value2,

POST http://<IP>:<PORT>/example/servlets/servlet/RequestInfoExample 

The above configuration will log the following.

...