1

How to tell Apache to log each request (visit)?? I'm looking for a bug in my code, and I have to track visitor.

1
  • It already does, by default.
    – jscott
    Oct 21, 2012 at 3:10

2 Answers 2

1

Out of the box, Apache does log quite a bit into /var/log/apache2, and also records every http request. If you have code going wrong, the tasty details may be in the error log hosted in that directory.

3
  • This post was tagged centos and in CentOS the logs are in /var/log/httpd by default. Oct 21, 2012 at 2:39
  • @MichaelHampton I spend time bipping between several distros, so not surprised I got it wrong.
    – sysadmin1138
    Oct 21, 2012 at 2:40
  • @sysadmin1138 - To be fair, he tagged it with both CentOS AND Apache. =)
    – David W
    Oct 21, 2012 at 2:41
0

Your question is fairly basic and also fairly vague, but I'm going to go ahead and take a stab at answering it anyway.

The short answer is yes, Apache can (but doesn't always) log requests. Apache can log several things. Normally error logs and access logs are logged to separate files. On one of my CentOS servers, I log errors to /var/log/httpd/error_log (and sometimes individual vhosts' error logs are logged to yet a different file location).

Access logs and Error logs are defined typically in /etc/httpd/conf/httpd.conf (CentOS / Red Hat) and /etc/apache2/apache2.conf.

However, vhosts will sometimes be configured to log errors and/or access logs to override the default setting.

Good luck.

Not the answer you're looking for? Browse other questions tagged .