RE: Rotate Logs | Number of Files | File Size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello CJ,

Many thanks for your suggestion & quick help. Indeed issue resolved.

Script used is below:

ErrorLog "| D:Apache24/bin/rotatelogs.exe -n 10 -l D:Apache24/logs/error.log 10M"
…
CustomLog "| D:Apache24/bin/rotatelogs.exe -n 10 -l D:Apache24/logs/access.log 10M" common

Warm Regards,
Ankit Khandelwal

-----Original Message-----
From: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
Sent: Saturday, 2 March, 2019 12:55 AM
To: users@xxxxxxxxxxxxxxxx; Khandelwal, Ankit <Ankit.K.Khandelwal@xxxxxxxxxxxxxxxxxxxx>
Subject: Re: Rotate Logs | Number of Files | File Size

** External email: Verify before clicking on links / attachments. **



Hi,

The doc should be more explicit, but based on reading the source code, it is likely that you get a:
     "Cannot use -n with % in filename"

You can not use -n and logfile name with '%' formatting character(s).

CJ


Le 01/03/2019 à 04:05, Khandelwal, Ankit a écrit :
> Hello Rainer,
>
> I tried executing below command, and it doesn't create the error file itself.
>
> ErrorLog "| D:/Apache24/bin/rotatelogs.exe -l -n 20 D:/Apache24/logs/error_apache_%Y-%m-%d-%H_%M_%S.log 10KB"
>
> Thanks & Regards,
> Ankit Khandelwal
>
> -----Original Message-----
> From: Rainer Jung <rainer.jung@xxxxxxxxxxx>
> Sent: Friday, 1 March, 2019 1:04 AM
> To: users@xxxxxxxxxxxxxxxx; Khandelwal, Ankit
> <Ankit.K.Khandelwal@xxxxxxxxxxxxxxxxxxxx>
> Subject: Re:  Rotate Logs | Number of Files | File Size
>
> ** External email: Verify before clicking on links / attachments. **
>
>
>
> Am 26.02.2019 um 09:53 schrieb Khandelwal, Ankit:
>> Hello All,
>>
>> I have configured rotatelogs inside httpd.conf at location:
>>
>> #
>>
>> # ErrorLog: The location of the error log file.
>>
>> # If you do not specify an ErrorLog directive within a <VirtualHost>
>>
>> # container, error messages relating to that virtual host will be
>>
>> # logged here.  If you *do* define an error logfile for a
>> <VirtualHost>
>>
>> # container, that host's errors will be logged there and not here.
>>
>> #
>>
>> ErrorLog "logs/error.log"
>>
>> ErrorLog "| D:/Apache24/bin/rotatelogs.exe -l
>> D:/Apache24/logs/error_apache_%Y-%m-%d-%H_%M_%S.log 10KB"
>>
>> The above command helps to split log file by 10 KB. However, I wish
>> to use number of files using -n as mentioned :
>>
>> https://clicktime.symantec.com/3X1pb2BfFaH7R8by7ThFK2H7Vc?u=https%3A%
>> 2 F%2Fhttpd.apache.org%2Fdocs%2Fcurrent%2Fprograms%2Frotatelogs.html
>>
>> Can anyone help me with exact syntax to use number of files in
>> addition to file size of 10 KB.
> According to the docs you linked to it would be
>
> ErrorLog "| D:/Apache24/bin/rotatelogs.exe -l -n 20 D:/Apache24/logs/error_apache_%Y-%m-%d-%H_%M_%S.log 10KB"
>
> The number "20" is just an example. Note that 10KB is pretty small for rotation, but of course a small size is helpful for quick rotation during low traffic test.
>
> Regards,
>
> Rainer
>
>
> **********************************************************************
> **********************************************************************
> Email Disclaimer: The contents of this e-mail and any attachment(s) may contain confidential or privileged information for the intended recipient(s). Unintended recipients are prohibited from taking action on the basis of information in this e-mail and using or disseminating the information, and must notify the sender and delete it from their system. Tata Technologies will not accept responsibility or liability for the accuracy or completeness of, or the presence of any virus or disabling code in this e-mail.
> **********************************************************************
> **********************************************************************
> ***
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



********************************************************************************************************************************************
Email Disclaimer: The contents of this e-mail and any attachment(s) may contain confidential or privileged information for the intended recipient(s). Unintended recipients are prohibited from taking action on the basis of information in this e-mail and using or disseminating the information, and must notify the sender and delete it from their system. Tata Technologies will not accept responsibility or liability for the accuracy or completeness of, or the presence of any virus or disabling code in this e-mail.
***********************************************************************************************************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux