Whats is the use of Tomcat access logs?

Posted on 2012-09-06
Last Modified: 2012-09-11
Hi there,

I have a  apache server that send requests to the app server (tomcat).

I aleady have the apache access logs,  and I am  seeing huge log files on the tomcat access logs. I dont see why I need t hose logs if I have the access logs on the web servers,.

After some research I  have found thius entry in server.xml:

<Valve  className="org.apache.catalina.valves.FastCommonAccessLogValve"

Is it safe to  comment  that out?  These logs are taking many hard drice space.. and I dont know why I would need them in the first place.

Question by:icongo
    LVL 10

    Accepted Solution

    Valves allow Tomcat server to "intercept a request and preprocess it". Its commonly used for logging such as you have. The one you mentioned, FastCommonAccessLogValve is enabled in default Tomcat setup.

    Incoming requests into the Catalina Engine are sent to the appropriate Host. When a valve is implemented, such as the FastCommonAccessLogValve, the Valve will intercept the request between the Engine and Host.

    So every request to every virtual host in the particular engine goes into the Valve. Then it is passed on to the Host. Access Logging enables the logging of requests (the URL, date and time). This site seems to explain the logs.

    You should be fine commenting it out. You can optimize your logging strategy based on your needs. So, if you are logging in httpd or Tomcat's <Host> or <Context> levels then it should be sufficient.

    It appears its been deprecated in Tomcat 6 and removed in Tomcat 7. AccessLogValve is recommended to replace it.

    It is a good way to save some space. However, Im no expert.

    Author Closing Comment


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    URL rewriting - LAMP 7 17
    ProxyPass - Problem 5 66
    Ubuntu 14 with Apache 7 64
    Apache Issues 9 20
    If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
    There are numerous questions about how to setup an IBM HTTP Server to be administered from WebSphere Application Server administrative console. I do hope this article will wrap things up and become a reference for this task. You need three things…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now