httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paras Fadte <plf...@gmail.com>
Subject Re: Using gzip and CustomLog
Date Wed, 21 Jan 2009 11:24:25 GMT
OS  used is SUSE LINUX 10.1 (X86-64)

On Wed, Jan 21, 2009 at 4:42 PM, Paras Fadte <plfgoa@gmail.com> wrote:
> Hi,
>
> Thanks for the response , I will try that . What I would like to know
> is whether one can combine the gzip usage with rotatelogs utility so
> that as the logs are written in gzipped format  they also get rotated
> as per the time/size specified .
>
> Thanks in advance.
>
> -Paras
>
> On Wed, Jan 21, 2009 at 4:27 PM, Rainer Jung <rainer.jung@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
>>
>>
>

Mime
View raw message