Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: --savefirst option #585

Open
jlearman opened this issue Feb 16, 2024 · 2 comments
Open

Feature Request: --savefirst option #585

jlearman opened this issue Feb 16, 2024 · 2 comments

Comments

@jlearman
Copy link

Please consider adding a "save first log" option.

I've often encountered cases when analyzing a bug I find I'd like to see information from the initial log, to make sure all resources were initialized properly or get a handle from an object created at system startup.

I believe this isn't difficult to using prerotate or postrotate, but the solutions I can think of would be susceptible to problems if other options are changed (for example, compression format, causing the names of rotated files to change.) Also, the only methods I can think of would not be efficient (e.g., always copying ${1}.1 if it exists) or might interfere with logrotate's assumptions (moving ${1}.1 if it exists.)

I've bumped into this in embedded systems so many times over the last 3 decades on different products at different companies, I'm surprised it's not a typical feature.

@cgzones
Copy link
Member

cgzones commented Mar 15, 2024

I am not sure I understand what you mean by "save first log"; save before what exactly?

@jlearman
Copy link
Author

When starting an application or subsystem, it logs. That's the "first log." Subsequently, due to logratate, the logging gets saved as (for example) log.1.gz.

Later, subsequent logging gets saved as log.2.gz and then log.3.gz. Eventually, when the max number of logs is reached, the oldest log is deleted.

The problem is that deleting log.1.gz removes the application/subsystem startup log, which often contains important information for interpreting later results. Dependencies are initialized, etc. This (and only this) log should be saved and never deleted (as an option.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants