Reputation: 172
I am developing a application to analyze the log files generated by tomcat. Tomcat generates various log files, but the most important one for me is localhost_access.log files. I want to alter the internal logging of tomcat so that tomcat create different local host files for the same day for different status messages.
Example:
1.localhost_access_log.2013-01-16.404.txt 2.localhost_access_log.2013-01-16.403.txt 3.localhost_access_log.2013-01-16.200.txt
I have a dedicated tomcat for my application. That is only one application runs on the tomcat, so no need to append application id.
Hope the question is clear. I searched for a long time in Google but could not find a reasonable site to start up. Any help would be appreciated. Thanks in advance..
Upvotes: 3
Views: 482
Reputation: 10987
Tomcat does the access logging using valve configuration in server.xml. It uses in-built class org.apache.catalina.valves.AccessLogValve which does not provide configuration you are looking at.
I believe your best bet would be to look to override the org.apache.catalina.valves.AccessLogValve class or write your own implementation by extending ValveBase. Update the server.xml with your new class info.
Upvotes: 1