Automattic / jetpack

Security, performance, marketing, and design tools — Jetpack is made by WordPress experts to make WP sites safer and faster, and help you grow your traffic.
https://jetpack.com/
Other
1.59k stars 798 forks source link

[Boost] Logger should log to one file and rotate old log files #35779

Open donnchawp opened 8 months ago

donnchawp commented 8 months ago

The Logger in the Cache module logs to a file with today's day of the month in it, and log files older than 24 hours will be deleted.

I would like to make some changes to that:

thingalon commented 8 months ago

One question: What's the advantage of logging to a single file instead of one based on today's date?

donnchawp commented 8 months ago

The main reason is that the site owner might need offline access to the logs, just in case there's a problem with WordPress. Logging to one filename makes it predictable, so it can be easily scripted, or even make it simple to run tail -f on it from the terminal, just by tapping up-arrow to get at a previous entry in the shell history.

The WPSC log is logged to a file with an md5 string as a filename, but the viewer doesn't need WordPress to load.

Besides, it's convention that logs are rotated daily, and usually 7 days logs are kept, with older ones gzipped. I wouldn't bother gzipping ours.

github-actions[bot] commented 1 month ago

This issue has been marked as stale. This happened because:

No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.