4 ms·
Those are cosmetic issues, in my book. The basic architecture is sound. In any serious application you will want to have a central logging wrapper anyway (I al
by layer8 4y ago
Those are cosmetic issues, in my book. The basic architecture is sound.
In any serious application you will want to have a central logging wrapper anyway (I always use one), which automatically takes care of the varargs issue.
The implementation of SimpleFormatter is 30 lines that you can easily copy and adjust as needed, including with your own custom format.
Regarding logger names, I always define an explicit set of logger names for the application, because that makes the logger names independent from implementation-detail subpackages, and any operations-side log filtering based on logger names will remains stable, regardless of how you refactor your implementation into Java packages. Basically, I see the logger names as part of the external interface of the application, and therefore I want to have them decoupled from the internal package structure, so that mere refactorings don't break that interface. You can still easily find all program locations that log to a specific logger, for example by Find Usages on the respective static Logger constant.