First and foremost: use slf4j exclusively as logging API, with logback as the underlying logging implementation. slf4j is a flexible API that can utilize any of the popular logging frameworks (logback, log4j, java.util.logging, etc) at runtime to provide the low-level logging implementation. As such, the only dependency in application components should be on the slf4j API; no class should reference any other logging interfaces.
Thursday, September 11, 2014
Java Application Logging Guidelines
Here are some guidelines or "best practices" for logging; they're hard-earned lessons from my own 17+ years' experience writing Java code as well as several other sources.
First and foremost: use slf4j exclusively as logging API, with logback as the underlying logging implementation. slf4j is a flexible API that can utilize any of the popular logging frameworks (logback, log4j, java.util.logging, etc) at runtime to provide the low-level logging implementation. As such, the only dependency in application components should be on the slf4j API; no class should reference any other logging interfaces.
First and foremost: use slf4j exclusively as logging API, with logback as the underlying logging implementation. slf4j is a flexible API that can utilize any of the popular logging frameworks (logback, log4j, java.util.logging, etc) at runtime to provide the low-level logging implementation. As such, the only dependency in application components should be on the slf4j API; no class should reference any other logging interfaces.
Subscribe to:
Posts (Atom)