Log4j

2. Create a new file 'log4j.properties' or 'log4j.xml' (case sensitive) and put it in your classpath. To be more concrete: Put it in your source directory, the file will be copied by Eclipse automatically to your build directory.For example:

Jakarta Commons Logging

Jakarta Commons Logging Framework is a wrapper for all common logging frameworks. If you want to use it, you have to install it AND the underlying logging framework. To install the Commons Logging download it from http://jakarta.apache.org/commons/logging/ and put the commons-logging.jar in your classpath. The Commons Logging Frameworks uses Log4j by default. When Log4j isn't found in classpath and JDK 1.4 or higher is being used, the JDK 1.4 logger will be used. If none of the above applies, Commons Logging will fall back to the internal SimpleLog.

It is also possible to specify the logging framework directly:

1. Create a new file 'commons-logging.properties' and put it in your classpath. To be more concrete: Put it in your source directory, the file will be copied by Eclipse automatically to your build directory.

As though it is not recommended to use Simplelog because it is not threadsafe, here's an example how to set it up:

1. Create a new file 'simplelog.properties' and put it in your classpath. To be more concrete: Put it in your source directory, the file will be copied by Eclipse automatically to your build directory.

2. Edit the 'simplelog.properties' to declare your own categories and log levels.

simplelog.properties example:

# Default logging detail level for all instances of SimpleLog. Must be one of # ("trace", "debug", "info", "warn", "error", or "fatal"). # If not specified, # defaults to "info".org.apache.commons.logging.simplelog.defaultlog=warn

# Logging detail level for a SimpleLog instance named "xxxxx". Must be one of # ("trace", "debug", "info", "warn", "error", or "fatal"). # If not specified, the default logging detail level is used.org.apache.commons.logging.simplelog.log.de.jayefem.log4e=debug

# Set to true if you want the Log instance name to be included in output # messages. Defaults to false.org.apache.commons.logging.simplelog.showlogname=false

# Set to true if you want the last componet of the name to be included in # output messages. Defaults to true.org.apache.commons.logging.simplelog.showShortLogname=true

# Set to true if you want the current date and time to be included in output # messages. Default is false.org.apache.commons.logging.simplelog.showdatetime=true