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

Question: PID and log rotation? #78

Closed
luebbe opened this issue Jun 23, 2023 · 3 comments
Closed

Question: PID and log rotation? #78

luebbe opened this issue Jun 23, 2023 · 3 comments
Labels

Comments

@luebbe
Copy link
Contributor

luebbe commented Jun 23, 2023

I could probably answer the question myself by looking at the code ;-), but:
How does the log rotation handle PIDs in filen ames, or how would it handle dates in file names (#66)?
If I start an application over and over again with a unique identifier in the log file name (PID, Date (kind of unique) :-), Date+Time, ...), would I get an infinite number of log files?
My expectation is that the log rotation should limit the number of created files by tag. So if I set the log rotation to ten and use a "unique" ID in the file name, the last ten starts of the application would be logged into separate files with a unique ID each.

@danieleteti
Copy link
Owner

PID in log file names has 2 utilization scenarios:

  • mantain log "by execution" avoiding log rotation in case of subsequent executions.
  • allow to use loggerpro when more than one instance is running (mostly in the case of desktop applications)

In all the other cases is not useful.

@luebbe
Copy link
Contributor Author

luebbe commented Jun 27, 2023

Let's rephrase this:

  • Should there be a (configurable) limit on the number of log files created when the PID is used?
  • Could the log rotation parameter serve as the limit? E.g. log rotation is set to 10. A maximum of ten logs per execution is kept.

@danieleteti
Copy link
Owner

Log Rotation requires that the filename can be regenerated based only on "index". So the filename cannot depend on time.
About the PID the reason a a bit different. Log Rotation can rotate logs generated by the same "run" but cannot rotate logs generated by a previuos run. However, in the case of PID, this is what you need (don't overwrite log from a previous run), so it's OK.

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

No branches or pull requests

2 participants