4 ms·
Log4j configuration isn't free either. Ask anyone who has ever been woken up by an asinine log rotation bug. (The tailer broke, or the rotation didn't happen...
by oasisbob 5y ago
Log4j configuration isn't free either. Ask anyone who has ever been woken up by an asinine log rotation bug. (The tailer broke, or the rotation didn't happen... again, etc)
Playing application log janitor is miserable. Just ship the logs and be done with it.
- rtpg 5y agoI mean if you write log rotation code yourself you will still be woken up by it. I agree that log configuration is a pain in the butt and oftentimes messy (especially when some third party lib includes a line to basically wipe your global config and everything gets wonky), but it's not like the heavy value adds are easy and bug-free to write!
- nostoc 5y agoI'll agree to this, but it's still a lot better than trying to implement it yourself.
- oasisbob 5y agoI agree, writing (and arguably configuring) robust logging libraries isn't much fun, and not easy to do yourself. So, don't. Ship the logs as quickly and as simply to a system which is explicitly for log management. The choice isn't between writing huge logging libraries or using log4j, it's whether you want an application to handle its own flat-file logging and rotation in the first place. Java has always been obnoxiously complex to steer towards sane, basic, modern syslog, which I think is a shame.