Capture Reqest and Response in Tomcat7

Install Logback

Download the logback distribution and  place the files logback-core-1.1.3.jar and logback-access-1.1.3.jar under $TOMCAT_HOME/lib/ directory.

Add LogbackValve

Add the below line in <Host/> tag of $TOMCAT_HOME/conf/server.xml

<Valve className="ch.qos.logback.access.tomcat.LogbackValve"/>

Add LogbackConfiguration File

Add logback-access.xml file in $TOMCAT_HOME/conf folder withr below content

  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
 <appender-ref ref="STDOUT" />


Add TeeFilter

Add the below filter in $TOMCAT_HOME/conf/web.xml



Start tomcat in Shell

$TOMCAT_HOME/bin/ run


You can use Advanced rest client to send request to server.


2 thoughts on “Capture Reqest and Response in Tomcat7

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s