com.opencms.boot
Class CmsLog

java.lang.Object
  |
  +--com.opencms.boot.CmsLog
All Implemented Interfaces:
source.org.apache.java.io.Logger

public class CmsLog
extends Object
implements source.org.apache.java.io.Logger

This class enables the OpenCms logging feature. Different logging channels are supported and can be (de)activated by the log settings in the proerty file.

Version:
$Revision: 1.2 $ $Date: 2001/07/31 15:50:12 $
Author:
Alexander Lucas

Constructor Summary
CmsLog(String identifier, source.org.apache.java.util.Configurations confs)
          The main constructor
 
Method Summary
 void flush()
          Writes any pending messages into the log media.
 boolean isActive()
          Check if this log is active.
 boolean isActive(String channel)
          Tells if the given channel is active.
 void log(String channel, String message)
          Prints the log message on the right channel.
 void log(String channel, Throwable t)
          Prints the error message and stack trace if channel enabled.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmsLog

public CmsLog(String identifier,
              source.org.apache.java.util.Configurations confs)
The main constructor

Method Detail

flush

public void flush()
Writes any pending messages into the log media.

Specified by:
flush in interface source.org.apache.java.io.Logger

isActive

public boolean isActive()
Check if this log is active.

Specified by:
isActive in interface source.org.apache.java.io.Logger
Returns:
true the log is active, false otherwise.

isActive

public boolean isActive(String channel)
Tells if the given channel is active.

Specified by:
isActive in interface source.org.apache.java.io.Logger
Parameters:
channel - the channel to test.
Returns:
true the given channel is active, false otherwise.

log

public void log(String channel,
                String message)
Prints the log message on the right channel.

A "channel" is a virtual log that may be enabled or disabled by setting the property "identifier".channel.???=true where ??? is the channel identifier that must be passed with the message. If a channel is not recognized or its property is set to false the message is not written.

Specified by:
log in interface source.org.apache.java.io.Logger
Parameters:
channel - the channel to put the message on.

log

public void log(String channel,
                Throwable t)
Prints the error message and stack trace if channel enabled.

Specified by:
log in interface source.org.apache.java.io.Logger
Parameters:
t - the error thrown.