Skip to main content
Tomcat Debugging
Alex Patnick avatar
Written by Alex Patnick
Updated over 9 months ago

For issues caused by Tomcat it is possible to get a debug log. Use the following procedure -

1) Edit the file /usr/local/tomcat9/webapps/WebServices/WEB-INF/web.xml and add at the end:

<filter>
    <filter-name>requestdumper</filter-name>
    <filter-class>
        org.apache.catalina.filters.RequestDumperFilter
    </filter-class>
</filter>
<filter-mapping>
    <filter-name>requestdumper</filter-name>
    <url-pattern>/proxy/reportDiscoveryTaskResult</url-pattern>
</filter-mapping>

before the closing </web-app> tag

2) Edit the file /usr/local/tomcat9/conf/logging.properties
At the top of the file in the line that starts with handlers = :
At the end of the line add a comma and then 1request-dumper.org.apache.juli.FileHandlerAt the end of the file, add:

1request-dumper.org.apache.juli.FileHandler.level = INFO
1request-dumper.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
1request-dumper.org.apache.juli.FileHandler.prefix = request-dumper.
1request-dumper.org.apache.juli.FileHandler.encoding = UTF-8
1request-dumper.org.apache.juli.FileHandler.formatter = org.apache.juli.VerbatimFormatter
org.apache.catalina.filters.RequestDumperFilter.level = INFO
org.apache.catalina.filters.RequestDumperFilter.handlers = \
  1request-dumper.org.apache.juli.FileHandler

After this, restart tomcat and run the process causing the issue and there should be a new log /usr/local/tomcat9/logs/request-dumper.XXXXX.log

Did this answer your question?