Sakai has a mix of logging libraries, mostly
- commons-logging (JCL)
The catalina.out log is mess because of all the different logging facilities and their different formats.
SLF4J was a good start as it is similar to JCL which abstracts the logging implementation so that someone could easily switch to a different logging implementation. The most notable reason why slf4j is a better choice is because of class loader issues. EntityBroker had much of its logging (JCL) removed due to class loader issues http://articles.qos.ch/classloader.html
As a way forward for new code using slf4j annotation:
or a more traditional approach:
Whether to use a static or instance member of the Logger are both fine see http://www.slf4j.org/faq.html#declared_static
We will always need JCL support due to many libraries requiring JCL like spring. Therefore using jcl-over-slf4j is needed for those libraries.
Lastly I am proposing a change the sakai appender's pattern to match the logger output of tomcat-juli so that the log4j and tomcat-juli look the same giving a consistent logging experience.
Lastly its worth noting that external libraries that output System.out will continue to do so like genericdao and rsf. These libraries are deprecated and should be avoided in the future.
Please see this link for examples of performance and logging http://www.slf4j.org/faq.html#logging_performance
For example: (1st line is traditional logging, 2nd line is updated for slf4j)
This doesn't mean that older method is not useful in certain situations but it does simplify the logging. Also another advantage is null params are printed as the word "null" in the replacement, instead of throwing NPE.