...
- Using the Apache commons logger is the recommended way to do logging in Sakai tools
- Adding the commons-logger dependency to your project.xml
- Add the following to the dependencies block of your project.xml file to include the commons-logger:
Code Block xml xml <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>1.0.4</version> </dependency>
- The commons logger is included in shared/lib by Sakai itself so you do not need to package it in your tool war file (hence there is no <war.bundle>true</war.bundle>)
- Version 1.0.4 was the current version when this was written
- Add the following to the dependencies block of your project.xml file to include the commons-logger:
- Adding the logger to your code
- Add the following line just below your class line:
Code Block private static Log log = LogFactory.getLog(TaskListManagerDaoImplMyClass.class);
- Make sure your class name is listed in place of MyClass
- The commons logger requires 2 imports (eclipse will insert these for you):
Code Block import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory;
- Add the following line just below your class line: