org.apache.commons.httpclient.log
Class LogSource

java.lang.Object
  |
  +--org.apache.commons.httpclient.log.LogSource

public class LogSource
extends java.lang.Object

Version:
$Id: LogSource.java,v 1.4 2001/10/04 17:49:15 rwaldhoff Exp $
Author:
Rod Waldhoff

Field Summary
protected static boolean _log4jIsAvailable
           
protected static java.util.HashMap _logs
           
 
Method Summary
static Log getInstance(java.lang.Class clazz)
           
static Log getInstance(java.lang.String name)
           
static java.util.Iterator getLogNames()
          Returns an iterator over the names of all logs known to me.
static Log makeNewLogInstance(java.lang.String name)
          Create a new Log implementation, based on the given name
static void setLevel(int level)
          Sets the log level for all Logs known to me.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_logs

protected static java.util.HashMap _logs

_log4jIsAvailable

protected static boolean _log4jIsAvailable
Method Detail

getInstance

public static Log getInstance(java.lang.String name)

getInstance

public static Log getInstance(java.lang.Class clazz)

makeNewLogInstance

public static Log makeNewLogInstance(java.lang.String name)
Create a new Log implementation, based on the given name

The specific Log implementation returned is determined by the value of the httpclient.log property. The value of httpclient.log may be set to the fully specified name of a class that implements the Log interface. This class must also have a public constructor that takes a single String argument (containing the name of the Log to be constructed.

When httpclient.log is not set, or when no corresponding class can be found, this method will return a Log4JCategoryLog if the log4j Category class is available in the LogSource's classpath, or a NoOpLog if it is not.

Parameters:
name - the log name (or category)

setLevel

public static void setLevel(int level)
Sets the log level for all Logs known to me.

getLogNames

public static java.util.Iterator getLogNames()
Returns an iterator over the names of all logs known to me.


Copyright (c) 2001 - Apache Software Foundation