You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2022/09/06 12:41:00 UTC

[Bug 66253] New: rotatelogs -n option log file suffix can't modify

https://bz.apache.org/bugzilla/show_bug.cgi?id=66253

            Bug ID: 66253
           Summary: rotatelogs -n option log file suffix can't modify
           Product: Apache httpd-2
           Version: 2.5-HEAD
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: support
          Assignee: bugs@httpd.apache.org
          Reporter: max.12@qq.com
  Target Milestone: ---

some log system only collect *.log

and rotatelogs with option -n will gen file log.1 log.2

can't be collect by log system

so rotatelogs need an option to make log file suffix fixed

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 66253] rotatelogs -n option log file suffix can't modify

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66253

--- Comment #2 from max <ma...@qq.com> ---
i want save log with 50M per file, and two file for rotate. total 100m space

is there a good method to gen log file  xx.1.log xx.2.log or
xx.2022-xxx(date).log

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 66253] rotatelogs -n option log file suffix can't modify

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66253

--- Comment #4 from Eric Covener <co...@gmail.com> ---
Whoops, never pasted:
https://httpd.apache.org/docs/2.4/programs/rotatelogs.html

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 66253] rotatelogs -n option log file suffix can't modify

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66253

Eric Covener <co...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All
             Status|NEW                         |NEEDINFO

--- Comment #1 from Eric Covener <co...@gmail.com> ---
-n is meant for circular set of files that overwrites itself, like short-term
trace. maybe it's not a good fit if you expect it to be collected.  

Not using -n  means you can choose whatever filename you like.

what's drawing you to -n in this case?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 66253] rotatelogs -n option log file suffix can't modify

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66253

--- Comment #7 from max <ma...@qq.com> ---
so it is too bother

so i think it can add option to control log file suffix when with -n option

can save log file with x.1.log x.2.log


thanks

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 66253] rotatelogs -n option log file suffix can't modify

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66253

--- Comment #6 from Eric Covener <co...@gmail.com> ---
(In reply to max from comment #5)
> while true; do echo 123; done | rotatelogs -n2 1.%Y-%m-%d-%H_%M_%S.log 1k 
> Cannot use -n with % in filename
> 
> 
> if not append -n2, it will gen many log file
> 
> how to make a limit of number of file

you can't do both at the same time with rotatelogs directly.

With -n, you could add a hard link to each file with a simple -p script:

```
#!/bin/bash

CURFILE=$1
PREVFILE=$2

ln -f $CURFILE ${CURFILE}.log
```

Or without -n, use something like logrotated to purge old log files.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 66253] rotatelogs -n option log file suffix can't modify

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66253

Eric Covener <co...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #3 from Eric Covener <co...@gmail.com> ---
The examples here show how to use a format string in the filename argument, you
can tack ".log" onto the end. Of course your 2nd arg will be "50M".

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 66253] rotatelogs -n option log file suffix can't modify

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66253

--- Comment #5 from max <ma...@qq.com> ---
while true; do echo 123; done | rotatelogs -n2 1.%Y-%m-%d-%H_%M_%S.log 1k 
Cannot use -n with % in filename


if not append -n2, it will gen many log file

how to make a limit of number of file

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 66253] rotatelogs -n option log file suffix can't modify

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66253

Eric Covener <co...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org