<ul><li>What is SLF4J? </li></ul><ul><li>When should SLF4J be used? </li></ul><ul><li>What are SLF4J's requirements? </li></ul><ul><li>Parameterized logging </li></ul><ul><li>Migration </li></ul><ul><li>Who use SLF4J </li></ul><ul><li>Demo </li></ul>
<ul><li>The Simple Logging Facade for Java or (SLF4J) serves as a simple facade or abstraction for various logging frameworks, e.g. java.util.logging, log4j and logback, allowing the end user to plug in the desired logging framework at deployment time. </li></ul><ul><li>http://www.slf4j.org/ </li></ul>
<ul><li>Suppose that your CRM application uses log4j for its logging. However, one of your important clients request that logging be performed through JDK 1.4 logging. </li></ul><ul><li>If your application is riddled with thousands of direct log4j calls, migration to JDK 1.4 would be a relatively lengthy and error-prone process. Even worse, you would potentially need to maintain two versions of your CRM software. </li></ul><ul><li>Had you been invoking SLF4J API instead of log4j, the migration could be completed in a matter of minutes by replacing one jar file with another . </li></ul>
Binding Requirements slf4j-nop JDK 1.3 slf4j-simple JDK 1.3 slf4j-log4j12 JDK 1.3, plus any other library dependencies required by the log4j appenders in use slf4j-jdk14 JDK 1.4 or above logback-classic JDK 1.5 or above, plus any other library dependencies required by the logback appenders in use
<ul><li>The SLF4J migrator is a small Java tool for migrating Java source files from the Jakarta Commons Logging (JCL) API to SLF4J. It can also migrate from the log4j API to SLF4J, or from java.util.logging API to SLF4J. </li></ul><ul><li>For further information, please check: http://www.slf4j.org/migrator.html </li></ul>
You don’t need to do any changes. 2009/11/24 下午 04:29:45 org.slf4j.impl.JCLLoggerAdapter info 資訊 : print info level log... 2009/11/24 下午 04:29:45 org.slf4j.impl.JCLLoggerAdapter error 嚴重的 : print error level log...
A particular slide catching your eye?
Clipping is a handy way to collect important slides you want to go back to later.