Class LogSource

java.lang.Object
org.apache.commons.logging.LogSource

public class LogSource
extends Object
Deprecated.
Use LogFactory instead - The default factory implementation performs exactly the same algorithm as this class did

Factory for creating Log instances. Applications should call the makeNewLogInstance() method to instantiate new instances of the configured Log implementation class.

By default, calling getInstance() will use the following algorithm:

  • If Log4J is available, return an instance of org.apache.commons.logging.impl.Log4JLogger.
  • If JDK 1.4 or later is available, return an instance of org.apache.commons.logging.impl.Jdk14Logger.
  • Otherwise, return an instance of org.apache.commons.logging.impl.NoOpLog.

You can change the default behavior in one of two ways:

  • On the startup command line, set the system property org.apache.commons.logging.log to the name of the org.apache.commons.logging.Log implementation class you want to use.
  • At runtime, call LogSource.setLogImplementation().
Version:
$Id: LogSource.java 155426 2005-02-26 13:10:49Z dirkv $
Author:
Rod Waldhoff