Apache使用TransferLog填充错误日志

我正在使用Apache 2.4和几个虚拟主机。 这是在Windows上,顺便说一句。 在每个虚拟主机中,我有以下日志文​​件configuration:

CustomLog "|bin/rotatelogs.exe -l ${SRVROOT}/logs/dev.ssl_request.%Y.%m.%d.log 86400" \ "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" env=HTTPS ErrorLog "|bin/rotatelogs.exe -l ${SRVROOT}/logs/dev.error.%Y.%m.%d.log 86400" TransferLog "|bin/rotatelogs.exe -l ${SRVROOT}/logs/dev.access.%Y.%m.%d.log 86400" 

这将是DEV虚拟主机。 其他(testing/ ua /等)基本上是相同的,除了ServerName和日志被命名为{环境} .error等。

现在,当我启动Apache的时候,错误日志文件会被一遍又一遍地重复一遍。 该消息是:

 Incorrect number of arguments Usage: C:\Program Files\Apache Software Foundation\Apache24\bin\rotatelogs.exe [-v] [-l] [-L linkname] [-p prog] [-f] [-t] [-e] [-n number] <logfile> {<rotation time in seconds>|<rotation size>(B|K|M|G)} [offset minutes from UTC] Add this: TransferLog "|C:\Program Files\Apache Software Foundation\Apache24\bin\rotatelogs.exe /some/where 86400" or TransferLog "|C:\Program Files\Apache Software Foundation\Apache24\bin\rotatelogs.exe /some/where 5M" to httpd.conf. By default, the generated name will be <logfile>.nnnn where nnnn is the system time at which the log nominally starts (NB if using a rotation time, the time will always be a multiple of the rotation time, so you can synchronize cron scripts with it). If <logfile> contains strftime conversion specifications, those will be used instead. At the end of each rotation time or when the file size is reached a new log is started. Options: -v Verbose operation. Messages are written to stderr. -l Base rotation on local time instead of UTC. -L path Create hard link from current log to specified path. -p prog Run specified program after opening a new log file. See below. -f Force opening of log on program start. -t Truncate logfile instead of rotating, tail friendly. -e Echo log to stdout for further processing. The program is invoked as "[prog] <curfile> [<prevfile>]" where <curfile> is the filename of the newly opened logfile, and <prevfile>, if given, is the filename of the previously used logfile. 

我无法弄清楚为什么会发生这种情况。 另外,在将Apache放在我们的Web服务器上之前,我在笔记本电脑上本地运行完全相同的设置,并且logging工作时没有错误信息。

有任何想法吗?

谢谢。

UPDATE

正如Jeff Snider所build议的那样,我更进了一步,删除了“$ {SRVROOT}”,并将所有内容都改为“logs / dev.error ….”。 我读了Apache文档,如果你不指定一个/然后它默认SRVROOT无论如何。

当我这样做后,我开始看到一些日志popup。 而且,错误日志是稳定的。 但是,几分钟后又开始发生了。

我甚至在每个环境中禁用了所有“TransferLog”,只有CustomLog和ErrorLog。 一样。

我现在的configuration是:

 CustomLog "|bin/rotatelogs.exe -l logs/dev.ssl_request.%Y.%m.%d.log\ 86400" \ "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" env=HTTPS ErrorLog "|bin/rotatelogs.exe -l logs/dev.error.%Y.%m.%d.log 86400" 

尝试在您的命令行中引用${SRVROOT} 。 我怀疑有空间,可能会看起来像几个单独的论点混淆。