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

lorotate enhancement #577

Open
JTakkalaki opened this issue Jan 11, 2024 · 3 comments
Open

lorotate enhancement #577

JTakkalaki opened this issue Jan 11, 2024 · 3 comments

Comments

@JTakkalaki
Copy link

Presently, the compression process involves initially copying the source log file to the destination file before initiating compression. This method poses concerns, especially on SSD devices, where write disk operations are critical. An improved approach would involve implementing compression without the necessity of copying the entire source log file to the destination file. Instead, compression could be performed directly on the destination file once the threshold limit is reached, reading from the source file as needed. Then truncate the source file portion, which has already been compressed.

@kdudka
Copy link
Member

kdudka commented Jan 11, 2024

In the default configuration, logrotate changes only name of the log file. logrotate does not copy the content of the log.

@JTakkalaki
Copy link
Author

@kdudka ,

I'm not referring to the default configuration; this relates to compression when reaching the threshold for the log limit.
The configuration is as follows:

  • compress
  • dateext
  • dateformat -%Y%m%d_%H%M%S
  • missingok

@kdudka
Copy link
Member

kdudka commented Jan 11, 2024

I do not think that any of the above directives would cause log content to be copied on the file system before compression. Of course, copytruncate would be another story...

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