I’m currently running Caddy as a reverse proxy and it’s working great. However, I’d like to rotate the logs every few hours (e.g. every 6 hours) instead of daily or based on size.
I couldn’t find a native option in the Caddy config for time-based log rotation. Is there a built-in way to do this, or would I need to handle it externally (like with logrotate or a custom script)?
Just trying to keep log files short and easy to manage for a system that gets bursts of traffic at specific intervals.
It’s not currently possible to roll based on time. It’s not a great control mechanism. It’s possible you have high traffic for one hour, so you get large log file for that one hour, then get minimal traffic the next hour, so you get a near-empty log file.
Thanks, Mohammed! That’s a solid point about inconsistent log sizes with time-based rotation. I’ll look into handling it externally with something like logrotate instead, really appreciate the clarity!