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

執筆者
Rich Bowen
Rich Bowen
Published: Jul 20, 2010
Updated: Nov 10, 2020
2 minute read
ServerWatch のコンテンツおよび製品のおすすめは、編集上の独立性を保っています。パートナーへのリンクをクリックすると、当社が報酬を得る場合があります。 詳細を見る



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.

TechnologyAdvice が所有・運営しています。 © 2026 TechnologyAdvice. 無断転載を禁じます

広告主に関する開示:このサイトに掲載されている製品の一部は、TechnologyAdvice が報酬を受け取っている企業のものです。この報酬は、製品がこのサイトのどこにどのように表示されるか(表示される順序など)に影響する場合があります。TechnologyAdvice は、市場で入手可能なすべての企業やすべての種類の製品を掲載しているわけではありません。