3 ms·
Yes, Java logging is ridiculously complicated for largely historical concerns that just don't make much sense in 2022. Like what you most likely need is a wrap
by marginalia_nu 4y ago
Yes, Java logging is ridiculously complicated for largely historical concerns that just don't make much sense in 2022.
Like what you most likely need is a wrapper for System.out that maybe does some clever buffering and backpressure management, but the rest is sensibly managed outside of the application; whether by logrotate, ELK, or whatever.
Long story short, no modern Java logging framework has any sensible reason to be much longer than a few hundred lines of code.
- kelnos 4y agoI don't 100% agree with this, because even when you're doing containers and just dumping your log output to stdout, you still might be shipping that to a log aggregation system that will work a lot better with structured logging. So you might want to output JSON or some other structured format, and you might want your logger to support tagging, markers, stuff like that. Even then, of course, this kind of logging should be able to be done in far fewer lines than most Java logging frameworks.