I tried this and It creates "mydomain.com-access_log.gz" but doesn't
seem to update it.

On Wed, Jan 21, 2009 at 4:27 PM, Rainer Jung <rainer.j...@kippdata.de> wrote:
> On 21.01.2009 07:09, Paras Fadte wrote:
>>
>> Hi ,
>>
>> Does something like following work in Apache/2.0.55 ?
>>
>> CustomLog "|/bin/gzip  -c
>>>>
>>>> /home/mydir/apache/logs/mydomain.com-access_log.gz" combined
>>
>> In errorlog it says :
>>
>> piped log program '/bin/gzip  -c
>>>>
>>>> /home/mydir/apache/logs/mydomain.com-access_log.gz' failed
>>
>> unexpectedly
>> gzip:>>/home/mydir/apache/logs/mydomain.com-access_log.gz: No such
>> file or directory
>>
>>
>> What could be the issue here ?
>
> It does work for me with Apache 2.2.x. Be sure to add whitespace before and
> after ">>" (although that wasn't necessary for 2.2.x).
>
> If it doesn't work for 2.0, you can use the following workaround, that
> should do it: create gzip.sh (executable shell script) with the content:
>
> #!/bin/sh
> gzip -c >> $1
>
> and use "|/path/to/gzip.sh mylogfile" in the CustomLog.
>
> Caution: it's possible to loose log lines when restarting or stopping the
> web server, because gzip buffers data and it might be implementation
> dependent, whether gzip flushes them when signaled to stop. My tests show,
> that there will be some information lost.
>
> I think this discussion belongs to the users list. When proceeding the
> discussion there, also mention which OS you are using.
>
> Regards,
>
> Rainer
>
>

Reply via email to