You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Ry...@chi.ddb.com on 2004/01/15 21:52:52 UTC

[users@httpd] Syntax error on specifying separate log files




I get this syntax error:  CustomLog takes two or three arguments, a file
name, a custom log format strong or format name and an optional "env-"
clause

Its weird because this is all I have in the file and its almost verbatim
what the example shows.  I also created text files in the Logs folder
called what you see below:



NameVirtualHost 172.20.10.138:80


<VirtualHost 172.20.10.138>


ServerName www.ddbchi.com


DocumentRoot /YellowTipWS/htdocs/ddbchi


CustomLog /logs/ddbchi.log


</VirtualHost>


<VirtualHost 172.20.10.138>


ServerName www.cultureddb.com


DocumentRoot /YellowTipWS/htdocs/


CustomLog /logs/cultureddb.log


<Directory />


Order allow,deny


Allow from 172.20.0.0/255.255.0.0 172.90.0.0/255.255.0.0 172.36.16.0
/255.255.0.0 172.36.20.0/255.255.0.0 172.37.16.0/255.255.0.0 172.37.20.0
/255.255.0.0 172.38.16.0/255.255.0.0 172.38.20.0/255.255.0.0 172.39.16.0
/255.255.0.0 172.39.20.0/255.255.0.0 172.40.16.0/255.255.0.0 172.40.20.0
/255.255.0.0 172.41.16.0/255.255.0.0 172.41.20.0/255.255.0.0 172.42.16.0
/255.255.0.0 172.42.20.0/255.255.0.0 64.60.95.131/255.255.255.0
64.60.95.138/255.255.255.0


</Directory>


</VirtualHost>


Any one have any ideas?


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Syntax error on specifying separate log files

Posted by Joshua Slive <jo...@slive.ca>.
On Thu, 15 Jan 2004 Ryan.Nix@chi.ddb.com wrote:
> I get this syntax error:  CustomLog takes two or three arguments, a file
> name, a custom log format strong or format name and an optional "env-"
> clause
>
> Its weird because this is all I have in the file and its almost verbatim
> what the example shows.  I also created text files in the Logs folder
> called what you see below:

What example shows this?

> CustomLog /logs/ddbchi.log

The error says "CustomLog takes two or three arguments", while you have
only supplied one argument, the filename.  You also need to tell apache
what format to write the logs in by specifying either a log format string
or a nickname defined by a previous LogFormat directive.

For example:
LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog /logs/ddbchi.log common

See:
http://httpd.apache.org/docs-2.0/mod/mod_log_config.html

Joshua.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Syntax error on specifying separate log files

Posted by "Roger B.A. Klorese" <ro...@queernet.org>.
> I get this syntax error:  CustomLog takes two or three 
> arguments, a file
> name, a custom log format strong or format name and an optional "env-"
> clause
> 
> Its weird because this is all I have in the file and its 
> almost verbatim
> what the example shows.

The docs say:

Syntax: CustomLog file|pipe format|nickname [env=[!]environment-variable]

The first argument, which specifies the location to which the logs will be
written, can take one of the following two types of values:

file 
A filename, relative to the ServerRoot. 

pipe 
The pipe character "|", followed by the path to a program to receive the log
information on its standard input. Security: if a program is used, then it
will be run as the user who started httpd. This will be root if the server
was started by root; be sure that the program is secure. 

The second argument specifies what will be written to the log file. It can
specify either a nickname defined by a previous LogFormat directive, or it
can be an explicit format string as described in the log formats section.

For example, the following two sets of directives have exactly the same
effect:

     # CustomLog with format nickname
     LogFormat "%h %l %u %t \"%r\" %>s %b" common
     CustomLog logs/access_log common

     # CustomLog with explicit format string
     CustomLog logs/access_log "%h %l %u %t \"%r\" %>s %b"

The third argument is optional and controls whether or not to log a
particular request based on the presence or absence of a particular variable
in the server environment. If the specified environment variable is set for
the request (or is not set, in the case of a 'env=!name' clause), then the
request will be logged.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org