Posts tagged SLF4J
Oracle Diagnostics Logging (ODL) for application development
1Logging is a very important aspect of application development as it offers run-time access to the behaviour and data of the application. It’s important for debugging purposes but also to investigate exception situations on production. The Java developer has a choice between logging frameworks but Log4J is probably the most used one. The usage is quite simple: grab a Logger, e.g. private static Logger log = Logger.getLogger(MyBean.class);, and then use that logger to log the actual message at the required level, log.debug(“This is a debug message”);. To print the logmessages, the Log4J is configured externally with a properties file that defines the location (e.g. console, file, database etc.) and the format of the logmessages. Other logging frameworks, like Java Util Logging, are used in a similar way. It’s actually a good practice to not use Log4J directly, but to use a wrapping or facade framework, that allows switching of the actual logging implementation itself. In the past that would have been Apache Commons Logging (ACL), but now SLF4J is commonly used because it doesn’t have the classloader issues of ACL and it provides some nice message formatting (and performance) More >
Recent Comments