
4 Aug
2023
4 Aug
'23
12:55 p.m.
In addition to the other suggestions, you might try switching logrotate from copytruncate mode to move/signal and reopen the log when the process gets signaled. Though I've never used that technique in ruby; I usually jump straight to syslog. (Even better: syslog local and forwarded to a collector over TCP/TLS with a local spool to buffer messages when the remote connection is down.) Another option is to log to stderr and let the service manager (daemontools, s6, systemd, etc.) or container runtime capture and preserve the messages.