Fedora Account System
Red Hat Associate
Red Hat Customer
Description of problem: According to the "logrotate" manual page there do exist the following directives to influence the file name of the rotated log file: - dateext - dateformat - dateyesterday The problem: all directives focus on date settings. The timestamp and its format cannot be specified for the created target log file. Especially, applications (e.g. Java, C++, etc.) that do rely on a special log file name have problems when using logrotate for rotating their logs. As "logrotate" does allow a hourly-based rotation there should be a possibility to specify the target log file name on a timestamp-based format, too. Version-Release number of selected component (if applicable): 3.8.7 How reproducible: no possibility to set the timestamp format :( Steps to Reproduce: 1. usage of logrotate 3.8.7 2. according to man page no possiblity to set timestamp based rotated log file names 3. Actual results: only date-based log file names are being created by logrotate (when using "hourly" a sequentially increased number is added at the end) Expected results: Introduction of additional directives like: - timext - timeformat Additional info: This might be more a feature request and not a bug report. In case where feature requests have to be entered anywhere else, please let me know. Kind regards, Holger
Hm, maybe you could try "dateformat -%s" to use timestamp.
Dear Jan Kaluza, I have to disappoint you: neither "dateformat -%s" nor "dateformat %s" worked with the following "logrotate" configuration (see "fs" attachment) Logrotate produced the following results when using: (1) dateformat -%s -> fs-server.log-%s.gz (2) dateformat %s -> fs-server.log%s.gz Any more hints or did I configure something wrong?
Created attachment 914247 [details] Example logrotate configuration to verify the behaviour regarding a time-based log file name creation after the rotation
Dear Jan Kaluža, based on my last feedback - did you find any configuration mistakes on my side? Would be kind to verify and let me know :) Kind regards, Holger
Dear Jan Kaluža, I'm really looking forward to reading from you again. Might be kind to give me a brief feedback :) Kind regards, Holger
does it literally create log files named like "fs-server.log-%s.gz"? Your config works for me when testing. Can you please try running logrotate with "-v" argument to get verbose debug output and paste it here?
Dear Jan Kaluža, interesting, that it works on your side. We executed the "logrotate" binary using the verbose option "-v": fs@si0vm997:/opt/wcms/fs/logrotate $ /opt/sfw/bin/logrotate -f -v -s /opt/wcms/fs/logrotate/fs.status /opt/wcms/fs/logrotate/fs_date reading config file /opt/wcms/fs/logrotate/fs_date Handling 1 logs rotating pattern: /opt/wcms/fs/log/fs-server.log forced from command line (96 rotations) empty log files are not rotated, old logs are removed considering log /opt/wcms/fs/log/fs-server.log log needs rotating rotating log /opt/wcms/fs/log/fs-server.log, log->rotateCount is 96 Converted ' -%s' -> '-%s' dateext suffix '-%s' glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]' glob finding old rotated logs failed running prerotate script copying /opt/wcms/fs/log/fs-server.log to /opt/wcms/fs/log/fs-server.log-%s truncating /opt/wcms/fs/log/fs-server.log compressing log with: /bin/gzip running last action script fs@si0vm997:/opt/wcms/fs/logrotate $ As you can see "logrotate" does not expand the "-%s" of the "dateformat" directive. Does "%s" expand to a unix timestamp calculated since 01.01.1970 or is there a possibility to specify a custom format for time as "YYYYMMHHSS"?
Dear Jan Kaluža, did my last post help you analysing/finding the problem? It seems as the dateext suffix is interpreted as pure text and not replaced.
Dear Jan Kaluža, long time ago with no feedback. Is there any possibility to get any help here? Kind regards, Holger
This message is a reminder that Fedora 20 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 20. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '20'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 20 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.