From: Ken Coar SetEnvIf Request_URI \.gif image-request
SetEnvIf Request_URI \.jpg image-request
SetEnvIf Request_URI \.png image-request
-CustomLog logs/access_log common env=!image-request
+CustomLog "logs/access_log" common env=!image-request
diff --git a/docs/manual/env.xml b/docs/manual/env.xml
index 3cda1acc64..db8c204c7c 100644
--- a/docs/manual/env.xml
+++ b/docs/manual/env.xml
@@ -509,7 +509,7 @@ BrowserMatch "JDK/1\.0" force-response-1.0
SetEnvIf Request_URI \.gif image-request
SetEnvIf Request_URI \.jpg image-request
SetEnvIf Request_URI \.png image-request
-CustomLog logs/access_log common env=!image-request
+CustomLog "logs/access_log" common env=!image-request
diff --git a/docs/manual/logs.html.en b/docs/manual/logs.html.en
index 4c4c58dd73..21b6e2413f 100644
--- a/docs/manual/logs.html.en
+++ b/docs/manual/logs.html.en
@@ -218,7 +218,7 @@
follows.
LogFormat "%h %l %u %t \"%r\" %>s %b" common -CustomLog logs/access_log common+CustomLog "logs/access_log" common
This defines the nickname common
and
@@ -359,7 +359,7 @@ CustomLog logs/access_log common
Log Format. It can be used as follows.
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" combined -CustomLog log/access_log combined+CustomLog "log/access_log" combined
This format is exactly the same as the Common Log Format,
@@ -409,9 +409,9 @@ CustomLog log/access_log combined
to mimic the effects of the ReferLog
and AgentLog
directives.
LogFormat "%h %l %u %t \"%r\" %>s %b" common -CustomLog logs/access_log common -CustomLog logs/referer_log "%{Referer}i -> %U" -CustomLog logs/agent_log "%{User-agent}i"+CustomLog "logs/access_log" common +CustomLog "logs/referer_log" "%{Referer}i -> %U" +CustomLog "logs/agent_log" "%{User-agent}i"
This example also shows that it is not necessary to define a @@ -437,16 +437,16 @@ SetEnvIf Remote_Addr "127\.0\.0\.1" dontlog # Mark requests for the robots.txt file SetEnvIf Request_URI "^/robots\.txt$" dontlog # Log what remains -CustomLog logs/access_log common env=!dontlog +CustomLog "logs/access_log" common env=!dontlog
As another example, consider logging requests from english-speakers to one log file, and non-english speakers to a different log file.
-SetEnvIf Accept-Language "en" english+
- CustomLog logs/english_log common env=english
- CustomLog logs/non_english_log common env=!english
SetEnvIf Accept-Language "en" english
+CustomLog "logs/english_log" common env=english
+CustomLog "logs/non_english_log" common env=!english
In a caching scenario one would want to know about @@ -455,7 +455,7 @@ CustomLog logs/access_log common env=!dontlog
SetEnv CACHE_MISS 1 LogFormat "%h %l %u %t "%r " %>s %b %{CACHE_MISS}e" common-cache -CustomLog logs/access_log common-cache+CustomLog "logs/access_log" common-cache
mod_cache
will run before
@@ -621,7 +621,7 @@ CustomLog "|$/usr/local/apache/bin/rotatelogs /var/log/access_log 86400" commo
consider the following directives.
LogFormat "%v %l %u %t \"%r\" %>s %b" comonvhost -CustomLog logs/access_log comonvhost+CustomLog "logs/access_log" comonvhost
The %v
is used to log the name of the virtual
diff --git a/docs/manual/logs.xml b/docs/manual/logs.xml
index da135778b3..3552837253 100644
--- a/docs/manual/logs.xml
+++ b/docs/manual/logs.xml
@@ -237,7 +237,7 @@
This defines the nickname common
and
@@ -383,7 +383,7 @@ CustomLog logs/access_log common
This format is exactly the same as the Common Log Format,
@@ -436,9 +436,9 @@ CustomLog log/access_log combined
This example also shows that it is not necessary to define a @@ -469,7 +469,7 @@ SetEnvIf Remote_Addr "127\.0\.0\.1" dontlog # Mark requests for the robots.txt file SetEnvIf Request_URI "^/robots\.txt$" dontlog # Log what remains -CustomLog logs/access_log common env=!dontlog +CustomLog "logs/access_log" common env=!dontlog
As another example, consider logging requests from @@ -477,9 +477,9 @@ CustomLog logs/access_log common env=!dontlog different log file.
In a caching scenario one would want to know about
@@ -489,7 +489,7 @@ CustomLog logs/access_log common env=!dontlog
Notice that quotes are used to enclose the entire command
@@ -664,7 +664,7 @@ CustomLog "|$/usr/local/apache/bin/rotatelogs /var/log/access_log 86400" commo
The %v
is used to log the name of the virtual
diff --git a/docs/manual/misc/perf-scaling.html.en b/docs/manual/misc/perf-scaling.html.en
index b855f8ce74..dcb35bc51e 100644
--- a/docs/manual/misc/perf-scaling.html.en
+++ b/docs/manual/misc/perf-scaling.html.en
@@ -620,8 +620,8 @@ Swap: 3903784 12540 3891244
a pipe character (|
). For instance:
The program on the other end of the pipe will receive the
@@ -1295,9 +1295,9 @@ Swap: 3903784 12540 3891244CustomLog "|/usr/local/apache2/bin/rotatelogs
- /var/log/access_log 86400" common
+
+CustomLog "|/usr/local/apache2/bin/rotatelogs /var/log/access_log 86400" common
|
). For instance:
- The program on the other end of the pipe will receive the @@ -1294,9 +1294,9 @@ Listen *:8001 </Directory> RewriteLog "/home/sctemme/inst/blog/httpd/logs/rewrite_log" RewriteLogLevel 9 - ErrorLog /home/sctemme/inst/blog/httpd/logs/error_log + ErrorLog "/home/sctemme/inst/blog/httpd/logs/error_log" LogLevel debug - CustomLog /home/sctemme/inst/blog/httpd/logs/access_log common + CustomLog "/home/sctemme/inst/blog/httpd/logs/access_log" common ScriptAlias "/cgi-bin/" "/home/sctemme/inst/blog/bin/" <Directory "/home/sctemme/inst/blog/bin"> Options +ExecCGI diff --git a/docs/manual/mod/core.html.en b/docs/manual/mod/core.html.en index 7ff7cc614c..2efebcf463 100644 --- a/docs/manual/mod/core.html.en +++ b/docs/manual/mod/core.html.en @@ -4540,8 +4540,8 @@ hostname or IP address ServerAdmin webmaster@host.example.com DocumentRoot "/www/docs/host.example.com" ServerName host.example.com - ErrorLog logs/host.example.com-error_log - TransferLog logs/host.example.com-access_log + ErrorLog "logs/host.example.com-error_log" + TransferLog "logs/host.example.com-access_log" </VirtualHost> @@ -4554,8 +4554,8 @@ hostname or IP address ServerAdmin webmaster@host.example.com DocumentRoot "/www/docs/host.example.com" ServerName host.example.com - ErrorLog logs/host.example.com-error_log - TransferLog logs/host.example.com-access_log + ErrorLog "logs/host.example.com-error_log" + TransferLog "logs/host.example.com-access_log" </VirtualHost> diff --git a/docs/manual/mod/core.xml b/docs/manual/mod/core.xml index f8fd4933c2..da9be22cb2 100644 --- a/docs/manual/mod/core.xml +++ b/docs/manual/mod/core.xml @@ -4553,8 +4553,8 @@ hostname or IP address ServerAdmin webmaster@host.example.com DocumentRoot "/www/docs/host.example.com" ServerName host.example.com - ErrorLog logs/host.example.com-error_log - TransferLog logs/host.example.com-access_log + ErrorLog "logs/host.example.com-error_log" + TransferLog "logs/host.example.com-access_log" </VirtualHost> @@ -4568,8 +4568,8 @@ hostname or IP address ServerAdmin webmaster@host.example.com DocumentRoot "/www/docs/host.example.com" ServerName host.example.com - ErrorLog logs/host.example.com-error_log - TransferLog logs/host.example.com-access_log + ErrorLog "logs/host.example.com-error_log" + TransferLog "logs/host.example.com-access_log" </VirtualHost> diff --git a/docs/manual/mod/mod_cache.html.en b/docs/manual/mod/mod_cache.html.en index 71a1122396..c67690eaf4 100644 --- a/docs/manual/mod/mod_cache.html.en +++ b/docs/manual/mod/mod_cache.html.en @@ -337,10 +337,10 @@ AddOutputFilterByType INCLUDES;CACHE;DEFLATE text/html
This makes it possible to support conditional logging of cached requests as per the following example:
-CustomLog cached-requests.log common env=cache-hit -CustomLog uncached-requests.log common env=cache-miss -CustomLog revalidated-requests.log common env=cache-revalidate -CustomLog invalidated-requests.log common env=cache-invalidate+
CustomLog "cached-requests.log" common env=cache-hit +CustomLog "uncached-requests.log" common env=cache-miss +CustomLog "revalidated-requests.log" common env=cache-revalidate +CustomLog "invalidated-requests.log" common env=cache-invalidate
For module authors, a hook called cache_status is available, diff --git a/docs/manual/mod/mod_cache.xml b/docs/manual/mod/mod_cache.xml index 8afde7fc0d..4f68feca86 100644 --- a/docs/manual/mod/mod_cache.xml +++ b/docs/manual/mod/mod_cache.xml @@ -327,10 +327,10 @@ AddOutputFilterByType INCLUDES;CACHE;DEFLATE text/html as per the following example:
For module authors, a hook called cache_status is available, diff --git a/docs/manual/mod/mod_deflate.html.en b/docs/manual/mod/mod_deflate.html.en index 6a1b064b12..eea05440dd 100644 --- a/docs/manual/mod/mod_deflate.html.en +++ b/docs/manual/mod/mod_deflate.html.en @@ -310,7 +310,7 @@ content
DeflateFilterNote ratio LogFormat '"%r" %b (%{ratio}n) "%{User-agent}i"' deflate - CustomLog logs/deflate_log deflate+ CustomLog "logs/deflate_log" deflate
If you want to extract more accurate values from your logs, you @@ -337,7 +337,7 @@ DeflateFilterNote Output outstream DeflateFilterNote Ratio ratio LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate -CustomLog logs/deflate_log deflate +CustomLog "logs/deflate_log" deflate
# CustomLog with format nickname LogFormat "%h %l %u %t \"%r\" %>s %b" common -CustomLog logs/access_log common +CustomLog "logs/access_log" common # CustomLog with explicit format string -CustomLog logs/access_log "%h %l %u %t \"%r\" %>s %b"+CustomLog "logs/access_log" "%h %l %u %t \"%r\" %>s %b"
The third argument is optional and controls whether or @@ -456,15 +456,15 @@ CustomLog logs/access_log "%h %l %u %t \"%r\" %>s %b" log, you can use:
SetEnvIf Request_URI \.gif$ gif-image -CustomLog gif-requests.log common env=gif-image -CustomLog nongif-requests.log common env=!gif-image+CustomLog "gif-requests.log" common env=gif-image +CustomLog "nongif-requests.log" common env=!gif-image
Or, to reproduce the behavior of the old RefererIgnore directive, you might use the following:
SetEnvIf Referer example\.com localreferer -CustomLog referer.log referer env=!localreferer+CustomLog "referer.log" referer env=!localreferer @@ -532,7 +532,7 @@ CustomLog referer.log referer env=!localreferer other format has been specified.
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" -TransferLog logs/access_log+TransferLog "logs/access_log"
The third argument is optional and controls whether or
@@ -496,8 +496,8 @@ CustomLog logs/access_log "%h %l %u %t \"%r\" %>s %b"
Or, to reproduce the behavior of the old RefererIgnore
@@ -505,7 +505,7 @@ CustomLog nongif-requests.log common env=!gif-image
%{
name}c
'' cryptography format function
provided. Information about this function is provided in the Compatibility chapter.
-CustomLog logs/ssl_request_log "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"+
CustomLog "logs/ssl_request_log" "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
mod_log_config
configurable logging formats:
LogFormat "%{Apache}n %r %t" usertrack -CustomLog logs/clickstream.log usertrack+CustomLog "logs/clickstream.log" usertrack
Create a log file with virtual host information in it:
LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" combined_plus_vhost -CustomLog logs/access_log combined_plus_vhost+CustomLog "logs/access_log" combined_plus_vhost
Log files will be created, in the directory where you run the
diff --git a/docs/manual/programs/split-logfile.xml b/docs/manual/programs/split-logfile.xml
index 63f8f8a43e..2e44c51b67 100644
--- a/docs/manual/programs/split-logfile.xml
+++ b/docs/manual/programs/split-logfile.xml
@@ -39,7 +39,7 @@
Log files will be created, in the directory where you run the diff --git a/docs/manual/rewrite/flags.html.en b/docs/manual/rewrite/flags.html.en index e0f65fc9d5..d1090ffcd2 100644 --- a/docs/manual/rewrite/flags.html.en +++ b/docs/manual/rewrite/flags.html.en @@ -273,7 +273,7 @@ environment variable is used to exclude those requests from the access log.
RewriteRule "\.(png|gif|jpg)$" "-" [E=image:1] -CustomLog logs/access_log combined env=!image+CustomLog "logs/access_log" combined env=!image
Note that this same effect can be obtained using SetEnvIf
. This technique is offered as
diff --git a/docs/manual/rewrite/flags.xml b/docs/manual/rewrite/flags.xml
index b3bccb2584..58eaae5e00 100644
--- a/docs/manual/rewrite/flags.xml
+++ b/docs/manual/rewrite/flags.xml
@@ -268,7 +268,7 @@ log.
Note that this same effect can be obtained using
LogFormat "%v %h %l %u %t \"%r\" %>s %b" vhost -CustomLog logs/multiple_vhost_log vhost+CustomLog "logs/multiple_vhost_log" vhost
This will create a log file in the common log format, but with the diff --git a/docs/manual/vhosts/fd-limits.xml b/docs/manual/vhosts/fd-limits.xml index 56c78c24b7..01091ee2ec 100644 --- a/docs/manual/vhosts/fd-limits.xml +++ b/docs/manual/vhosts/fd-limits.xml @@ -93,7 +93,7 @@ of your log format string:
This will create a log file in the common log format, but with the diff --git a/docs/manual/vhosts/mass.html.en b/docs/manual/vhosts/mass.html.en index 1b98c65211..d021778b1d 100644 --- a/docs/manual/vhosts/mass.html.en +++ b/docs/manual/vhosts/mass.html.en @@ -163,7 +163,7 @@ UseCanonicalName Off # this log format can be split per-virtual-host based on the first field # using the split-logfile utility. LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon -CustomLog logs/access_log vcommon +CustomLog "logs/access_log" vcommon # include the server name in the filenames used to satisfy requests VirtualDocumentRoot "/www/hosts/%0/docs" @@ -196,7 +196,7 @@ examples.
UseCanonicalName Off LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon -CustomLog logs/access_log vcommon +CustomLog "logs/access_log" vcommon # include part of the server name in the filenames VirtualDocumentRoot "/home/%2/www" @@ -240,7 +240,7 @@ LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon <VirtualHost 111.22.33.44> ServerName www.commercial.example.com - CustomLog logs/access_log.commercial vcommon + CustomLog "logs/access_log.commercial" vcommon VirtualDocumentRoot "/www/commercial/%0/docs" VirtualScriptAlias "/www/commercial/%0/cgi-bin" @@ -249,7 +249,7 @@ LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon <VirtualHost 111.22.33.45> ServerName www.homepages.example.com - CustomLog logs/access_log.homepages vcommon + CustomLog "logs/access_log.homepages" vcommon VirtualDocumentRoot "/www/homepages/%0/docs" ScriptAlias "/cgi-bin/" "/www/std-cgi/" @@ -284,7 +284,7 @@ UseCanonicalName DNS # include the IP address in the logs so they may be split LogFormat "%A %h %l %u %t \"%r\" %s %b" vcommon -CustomLog logs/access_log vcommon +CustomLog "logs/access_log" vcommon # include the IP address in the filenames VirtualDocumentRootIP "/www/hosts/%0/docs" diff --git a/docs/manual/vhosts/mass.xml b/docs/manual/vhosts/mass.xml index ea52263c2f..3c7c7db048 100644 --- a/docs/manual/vhosts/mass.xml +++ b/docs/manual/vhosts/mass.xml @@ -154,7 +154,7 @@ UseCanonicalName Off # this log format can be split per-virtual-host based on the first field # using the split-logfile utility. LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon -CustomLog logs/access_log vcommon +CustomLog "logs/access_log" vcommon # include the server name in the filenames used to satisfy requests VirtualDocumentRoot "/www/hosts/%0/docs" @@ -188,7 +188,7 @@ examples. UseCanonicalName Off LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon -CustomLog logs/access_log vcommon +CustomLog "logs/access_log" vcommon # include part of the server name in the filenames VirtualDocumentRoot "/home/%2/www" @@ -233,7 +233,7 @@ LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon <VirtualHost 111.22.33.44> ServerName www.commercial.example.com - CustomLog logs/access_log.commercial vcommon + CustomLog "logs/access_log.commercial" vcommon VirtualDocumentRoot "/www/commercial/%0/docs" VirtualScriptAlias "/www/commercial/%0/cgi-bin" @@ -242,7 +242,7 @@ LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon <VirtualHost 111.22.33.45> ServerName www.homepages.example.com - CustomLog logs/access_log.homepages vcommon + CustomLog "logs/access_log.homepages" vcommon VirtualDocumentRoot "/www/homepages/%0/docs" ScriptAlias "/cgi-bin/" "/www/std-cgi/" @@ -278,7 +278,7 @@ UseCanonicalName DNS # include the IP address in the logs so they may be split LogFormat "%A %h %l %u %t \"%r\" %s %b" vcommon -CustomLog logs/access_log vcommon +CustomLog "logs/access_log" vcommon # include the IP address in the filenames VirtualDocumentRootIP "/www/hosts/%0/docs"