top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Http Request/Response logging in embedded tomcat

0 votes
486 views

I have a requirement to monitor http request/response logs. We have a embedded Tomcat 7. Could you please point out the options available to do this?.
I'm already aware of the Access Log Valve ( http://www.tomcat.apache.org/tomcat-7.0-doc/config/valve.html#Access_Log_Valve ). But it can only log separate request headers and query params of the request body..
Would like to know if there is any better approach..

posted Jul 9, 2013 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

How about the ExtendedAccessLogValve or RequestDumperFilter?

https://tomcat.apache.org/tomcat-7.0-doc/config/valve.html#Extended_Access_Log_Valve
https://tomcat.apache.org/tomcat-7.0-doc/config/filter.html#Request_Dumper_Filter

You could also write a custom Valve or Filter if you have very specific needs.

answer Jul 9, 2013 by anonymous
Similar Questions
+1 vote

We have a set up like Apahce (80,443) redirects the request to Tomcat (8080) using mod_jk.

The new requirement is to route the request from the same apache to another tomcat (8090). Hence I made the different config file for apache with different ports (86,4444) and different worker for mod_jk which routes the request to tomcat.

Now the issue is when I hit the url http://:86 and after providing the credentials, it is redirecting to https://:86 and throwing the below error.

Error in browser:

Secure Connection Failed

An error occurred during a connection to x.x.x.x:86. SSL received a record that exceeded the maximum permissible length. (Error code: ssl_error_rx_record_too_long)

Error in logs:

"x16x03x01" 501

[Thu Jan 08 08:22:46 2015] [debug] ssl_engine_io.c(1523): OpenSSL: I/O error, 11 bytes expected to read on BIO#1bf568 [mem: 1f3930]
[Thu Jan 08 08:22:46 2015] [debug] ssl_engine_kernel.c(1806): OpenSSL: Exit: error in SSLv2/v3 read client hello A
[Thu Jan 08 08:22:46 2015] [info] (70014)End of file found: SSL handshake interrupted by system [Hint: Stop button pressed in browser?!]
[Thu Jan 08 08:22:46 2015] [info] Connection to child 3 closed with abortive shutdown(server pritoolvca1.sw.ericsson.se:443 [2], client 153.88.164.216)
[Thu Jan 08 08:23:53 2015] [error] [client 172.17.136.153] Invalid method in request x16x03x01

Could you please suggest where it might went wrong and the way forward..

+1 vote

My development setup is Win7 while my production is RHEL6. Both of the environments have the same settings in conf/logging.properties but the files in logs/ are slightly different.

The access logs are named the same way. But on RHEL there's no tomcat7-stdout or tomcat7-stderr log files. Just 'catalina.out.YEAR.MO.DY' and the cumulative "catalina.out" with no date.

What accounts for the differences? Also, how would you stop logging to the 'catalina.out' file. It gets unusably gigantic within a few days.

+1 vote

In tomcat does the no . of open sockets on http port (netstat -anlp|grep 8080) is it equal to number of threads in use in tomcat .
Actually I want to understand how & when I can say that the all threads in a tomcat are fully utilized that why it is responding slow.

+1 vote

I had installed tomcat 8 port 80 on Amazon AWS EC2, but netstat, fuser does show me tomcat on port 80. Browser gives 404 error and connection refused. I wrote to Amazon support for the misery...

0 votes

I have written a PKI proxy servlet to support a tool that needs access to my customer's secured web site, but the application does not support client certificate security. The Servlet works great when called from a browser, where the proxy uses a B2B certificate for access and forwards the response to the browser as expected. That seemed like a good prototype, however, when I went to test against the tool I found that it was not making a GET request, but rather a CONNECT request. I extended my code to accept the CONNECT, however the request never seems to get past the front door Tomcat. None of my code is ever called, so I have to assume that I have a setting wrong in Tomcat.

Everything I can find online discusses how you should not have a Tunneling proxy in your infrastructure, but this is all in a secured environment, not on the internet, so this is not an issue and has been approved. Is there something I am missing?

...