rotatelog command and CustomLog / TransferLog

rotatelog command and CustomLog / TransferLog

Post by JDor » Fri, 24 Jan 2003 09:23:46



I am trying to understand how to use the Apache rotatelog command, and
reading any documentation or newsgroup postings has not completely
answered my questions, so here goes...

Server 1:
Apache running on Sun Solaris server, v2.8
Current httpd.conf information:

LogFormat "%h %l %u %t \"%r\" %>s %b" common
#
# The location and format of the access logfile (Common Logfile Format).

# If you do not define any access logfiles within a <VirtualHost>
# container, they will be logged here.  Contrariwise, if you *do*
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file.
#
CustomLog /www/a/apache/logs/access_log common

##
## SSL Virtual Host Context
##

<VirtualHost _default_:8443>

#  General setup for the virtual host
DocumentRoot "/www/a/apache/htdocs"
#ServerName abc.xyz.com

ErrorLog /www/a/apache/logs/error_log
TransferLog /www/a/apache/logs/access_log

... So, if I understand this correctly, in this case since there is a
Virtual Host defined, the CustomLog directive is basically ignored and
all logging is put into the file defined by TransferLog (which, in this
case, is the same file ...).  I should be able to modify the TransferLog
statement to read:
TransferLog "|/www/a/apache/bin/rotatelogs
/www/a/apache/logs/access_log 604800"
and the result will be daily access_logs ....

Comments? Am I understanding the information they have in the file?

Server 2:
Apache running on Sun Solaris server, v2.8
Current httpd.conf information:

# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "%h %l %u %t \"%r\" %>s %b" common

#
#SetEnvIf directive included to stop pings from being logged - 011303
SetEnvIf Request_URI "HEAD / HTTP/1.0" nolog

#
# The location and format of the access logfile (Common Logfile Format).

# If you do not define any access logfiles within a <VirtualHost>
# container, they will be logged here.  Contrariwise, if you *do*
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file.
#
# CustomLog logs/access_log common 011303: Replaced with nolog line
CustomLog logs/access_log common env=!nolog

... there is NO Virtual Host or TransferLog defined .....

In this case, how would I use the rotatelogs utility?

I do not think CustomLog "|/www/Artesia/apache/bin/rotatelogs
/www/Artesia/apache/logs/access_logs 604800" env=!nolog  will
work......

Suggestions / comments?

Thanks,
Jon

 
 
 

1. Won't allow TransferLog or CustomLog in VH

Hello,

I've searched hi and low for an answer to this problem with no luck.  Maybe
someone here can help.

I have Red Hat 6.2 running Apache with name based vitual hosts.  I'm trying
to set up different access logs for each domain either using the TransferLog
or CustomLog directive.  My problem is when I place either of these
directives within the virtual host info, when Apache tries to start up I get
"Invalid command 'TransferLog', perhaps mis-spelled or defined by a module
not included in the server configuration."  The ErrorLog directive works
within the virtual host info and CustomLog works in the default server.

I'm at a total loss.  Can somebody please help me.

Thank you,
Chris

2. Can I use linux???

3. Problems with Start Apache 1.2.0 ==> Invalid command TransferLog

4. Loadlin, Way to GO !!!

5. Matrox Mystique ands X.

6. ATI 9700 Pro and ATI drivers fglrx

7. How does rotatelog work?

8. Cannot execute a script thru cron (SVR4)

9. TransferLog pipe

10. Apache, httpd.conf, transferLog: Limiting certain files from being logged

11. Apache Transferlog Limit GET

12. Apache TransferLog upload count?

13. TransferLog directive question