3 ms·
I thought you just rely on rsyslog or journald for this stuff...
by cozzyd 5y ago
I thought you just rely on rsyslog or journald for this stuff...
- ninkendo 5y agoRight? Logs are streams, not files. To a first approximation, you should just log to standard out, and let another system take care of sending your output to either a file (with rotation) or logstash, or syslog, or a whatever else is appropriate. To a second approximation (if you’re already using stdout for something else), the thing you’re logging to should still be a file descriptor, but not a file per se. (perhaps a local socket to a logging system like syslog.) I don’t need everything on my system that logs, to invent its own log output directory, and implement its own log rotation. That’s how you get a mishmash of different places where logs end up living, and they become very difficult to collate or compare, etc.
- christophilus 5y agoYou do. None of the logging libraries I’ve used in the past 5 years even have log rotation as a feature, from what I can tell.