Tomcat 7 does not support the RequestDumperValve that was available Tomcat 6 and earlier.
What is its recommended replacement in Tomcat 7?
Tomcat 7 does not support the RequestDumperValve that was available Tomcat 6 and earlier.
What is its recommended replacement in Tomcat 7?
And to answer my own question, more extensive Googling came up with this:
RequestDumperValve has been replaced by RequestDumperFilter, part of an effort to replace Valves with Filters to be more spec-compliant, and therefore more flexible. This is the class you want: org.apache.catalina.filters.RequestDumperFilter
Also see: http://tomcat.apache.org/tomcat-7.0-doc/config/filter.html#Request_Dumper_Filter
Note that you will configure this component in web.xml, now, and not in context.xml.
As an addendum to the original answer, here is a little bit more detail. It isn't fully clear how to get this configured and actually dumping to a file unless you are familiar with the way the logging.properties file is set up in Tomcat 7. Here is how I was able to get the dumper working:
a. Add the request dumper file handler to the list of handlers
handlers = ... , 5request-dumper.org.apache.juli.FileHandler, ...
b. Add in the appropriate file handling code for the request-dumper log file
# request dumper configuration
5request-dumper.org.apache.juli.FileHandler.level = INFO
5request-dumper.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
5request-dumper.org.apache.juli.FileHandler.prefix = request-dumper.
5request-dumper.org.apache.juli.FileHandler.formatter = org.apache.juli.VerbatimFormatter
org.apache.catalina.filters.RequestDumperFilter.level = INFO
org.apache.catalina.filters.RequestDumperFilter.handlers = 5request-dumper.org.apache.juli.FileHandler
I believe the key step is adding in your reference to the "handlers" list. If you just add in the section with the logging configuration it doesn't appear to pick up the changes and create the file.
-rOcK
© 2022 - 2024 — McMap. All rights reserved.