[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1214
  • Last Modified:

Whats is the use of Tomcat access logs?

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"
                        directory="/opt/hybris/log/tomcat"
                                prefix="access."
                                suffix=".log"
                                pattern="combined"
          />            


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.


Thanks,
0
icongo
Asked:
icongo
1 Solution
 
GreggCommented:
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.
0
 
icongoAuthor Commented:
Thanks.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now