Apache Guide: Logging with Apache–Understanding Your access_log Page 3

Écrit par
Rich Bowen
Rich Bowen
Published: Jul 20, 2010
Updated: Nov 10, 2020
2 minute read
ServerWatch Le contenu et les recommandations de produits sont indépendants de la rédaction. Nous pouvons gagner de l'argent lorsque vous cliquez sur des liens vers nos partenaires. En savoir plus



The seventh and final piece of information is the total number of bytes
that were transferred to the client. This can tell you if a transfer
was interrupted (if the number is different from the size of the file).
Adding them up will tell you how much data your server transferred in a
day, or week, or whatever.

Setting the location of your access_log

Where the access_log is located is actually a configuration option.
If you look in your configuration file, httpd.conf, you should see
a line that looks like the following:

        CustomLog /usr/local/apache/logs/access_log common

Note: If you're running an older version of Apache, this line might
look a little different. It might be the TransferLog directive instead
of the CustomLog directive. If that is the case, I really recommend
that you upgrade if at all possible.

The CustomLog directive specifies where a particular log file should
be stored, and what format that log should be in. Next week we'll talk
about custom log formats. The log format described above is the common
log format, which has been in use as the standard since the beginning of
web servers. That's why it still contains the ident information field,
even though almost no clients actually pass that information to the
server.

The path specified there is the location of the log file. Note that this
location should be secured against random users writing to it, since the
log file is opened by the HTTP user (specified with the User directive),
and so this is potentially a security problem.

Upcoming articles

In my next few articles, I'll be talking about the following subjects: Custom
log format. Logging to a process, rather than to a file. The error log.
Getting useful statistics out of your log files. And whatever else you
fine readers suggest to me.

Thanks for reading. Please send me a note at ApacheToday@rcbowen.com if
you have any suggestions or comments.

Want to discuss log files with other Apache Today readers? Then check out the PHP discussion at Apache Today Discussions.

Rich Bowen

Rich Bowen is a ServerWatch contributor.

ServerWatch Logo

ServerWatch is a top resource on servers. Explore the latest news, reviews and guides for server administrators now.

Propriété de TechnologyAdvice. © 2026 TechnologyAdvice. Tous droits réservés

Divulgation publicitaire : Certains des produits qui apparaissent sur ce site proviennent d'entreprises dont TechnologyAdvice reçoit une compensation. Cette compensation peut influencer la façon dont les produits apparaissent sur ce site, notamment l'ordre dans lequel ils apparaissent. TechnologyAdvice n'inclut pas toutes les entreprises ou tous les types de produits disponibles sur le marché.