org.apache.jetspeed.services.logging
Class BaseLogger

java.lang.Object
  extended byorg.apache.jetspeed.services.logging.BaseLogger
All Implemented Interfaces:
org.apache.turbine.services.logging.Logger

public class BaseLogger
extends java.lang.Object
implements org.apache.turbine.services.logging.Logger

Classes that implement the Logger interface allows loging. There is set of standart printing methods (info, debug ...). This is a wrapper for the commons Log object.

Version:
$Id: BaseLogger.java,v 1.3 2004/02/23 03:33:29 jford Exp $
Author:
Mark Orciuch, Harald Ommang

Field Summary
 
Fields inherited from interface org.apache.turbine.services.logging.Logger
BACKUP_KEY, CONSOLE_KEY, DB_KEY, DB_LOGGER_KEY, DB_POOL_KEY, DEBUG, EMAIL_KEY, EMAILBUFFERSIZE_KEY, EMAILFROM_KEY, EMAILSUBJECT_KEY, EMAILTO_KEY, ERROR, FACILITY_KEY, FILE_KEY, FORMAT_KEY, HOST_KEY, INFO, LEVELDEBUG, LEVELERROR, LEVELINFO, LEVELWARN, PATH_KEY, PORT_KEY, REMOTE_KEY, SIZE_KEY, SYSLOGD_KEY, WARN
 
Constructor Summary
BaseLogger(JetspeedLogger log)
          Parametrized constructor
 
Method Summary
 boolean checkLogger()
          This method should be implemented by user.
 void debug(java.lang.String message)
          This is a log method with logLevel == DEBUG
 void debug(java.lang.String message, org.apache.turbine.util.RunData data)
          This is a log method with logLevel == DEBUG
 void debug(java.lang.String message, org.apache.turbine.util.RunData data, java.lang.Throwable t)
          This is a log method with logLevel == DEBUG
 void debug(java.lang.String message, java.lang.Throwable t)
          This is a log method with logLevel == DEBUG
 void error(java.lang.String message)
          This is a log method with logLevel == ERROR
 void error(java.lang.String message, org.apache.turbine.util.RunData data)
          This is a log method with logLevel == ERROR
 void error(java.lang.String message, org.apache.turbine.util.RunData data, java.lang.Throwable e)
          This is a log method with logLevel == ERROR
 void error(java.lang.String message, java.lang.Throwable e)
          This is a log method with logLevel == ERROR
 void error(java.lang.Throwable e)
          This is a log method with logLevel == ERROR
 JetspeedLogger getLog()
          Reference to logger
 java.lang.String getName()
          name of the logger
 void info(java.lang.String message)
          This is a log method with logLevel == INFO
 void info(java.lang.String message, org.apache.turbine.util.RunData data)
          This is a log method with logLevel == INFO
 void info(java.lang.String message, org.apache.turbine.util.RunData data, java.lang.Throwable t)
          This is a log method with logLevel == INFO
 void info(java.lang.String message, java.lang.Throwable t)
          This is a log method with logLevel == INFO
 void init(org.apache.turbine.services.logging.LoggingConfig loggingConfig)
          This method sets parameters for the logger implementation.
 boolean isDebugEnabled()
          Checks if DEBUG statements are enabled.
 boolean isErrorEnabled()
          Checks if ERROR statements are enabled.
 boolean isInfoEnabled()
          Checks if INFO statements are enabled.
 boolean isWarnEnabled()
          Checks if WARN statements are enabled.
 void setFormat(java.lang.String format)
          Sets format style for extracting data from RunData
 void setLog(JetspeedLogger log)
          Sets reference to JetspeedLogger
 void setLogLevel(int level)
          Sets log level for the logger
 void setName(java.lang.String logName)
          Setings the name
 void shutdown()
          Close all destinations
 void warn(java.lang.String message)
          This is a log method with logLevel == WARN
 void warn(java.lang.String message, org.apache.turbine.util.RunData data)
          This is a log method with logLevel == WARN
 void warn(java.lang.String message, org.apache.turbine.util.RunData data, java.lang.Throwable t)
          This is a log method with logLevel == WARN
 void warn(java.lang.String message, java.lang.Throwable t)
          This is a log method with logLevel == WARN
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseLogger

public BaseLogger(JetspeedLogger log)
Parametrized constructor

Parameters:
log -
Method Detail

getName

public java.lang.String getName()
name of the logger

Specified by:
getName in interface org.apache.turbine.services.logging.Logger
Returns:
log name

setName

public void setName(java.lang.String logName)
Setings the name

Specified by:
setName in interface org.apache.turbine.services.logging.Logger
Parameters:
logName -

getLog

public JetspeedLogger getLog()
Reference to logger

Returns:
JetspeedLogger

setLog

public void setLog(JetspeedLogger log)
Sets reference to JetspeedLogger

Parameters:
log -

checkLogger

public boolean checkLogger()
This method should be implemented by user. It performs action that are need for deterimne whether logger was well configured or has any output

Specified by:
checkLogger in interface org.apache.turbine.services.logging.Logger
Returns:
true if logger is well configured

init

public void init(org.apache.turbine.services.logging.LoggingConfig loggingConfig)
This method sets parameters for the logger implementation. If the implementation cannot handle some type of destination should ignore that output.

Specified by:
init in interface org.apache.turbine.services.logging.Logger

shutdown

public void shutdown()
Close all destinations

Specified by:
shutdown in interface org.apache.turbine.services.logging.Logger

setLogLevel

public void setLogLevel(int level)
Sets log level for the logger

Specified by:
setLogLevel in interface org.apache.turbine.services.logging.Logger
Parameters:
level -

isDebugEnabled

public boolean isDebugEnabled()
Checks if DEBUG statements are enabled.

Specified by:
isDebugEnabled in interface org.apache.turbine.services.logging.Logger
Returns:
true if debug is enabled

isInfoEnabled

public boolean isInfoEnabled()
Checks if INFO statements are enabled.

Specified by:
isInfoEnabled in interface org.apache.turbine.services.logging.Logger
Returns:
true if into is enabled

isWarnEnabled

public boolean isWarnEnabled()
Checks if WARN statements are enabled.

Specified by:
isWarnEnabled in interface org.apache.turbine.services.logging.Logger
Returns:
true if warn is enabled

isErrorEnabled

public boolean isErrorEnabled()
Checks if ERROR statements are enabled.

Specified by:
isErrorEnabled in interface org.apache.turbine.services.logging.Logger
Returns:
true if error is enabled

setFormat

public void setFormat(java.lang.String format)
Sets format style for extracting data from RunData

Specified by:
setFormat in interface org.apache.turbine.services.logging.Logger
Parameters:
format -

debug

public void debug(java.lang.String message)
This is a log method with logLevel == DEBUG

Specified by:
debug in interface org.apache.turbine.services.logging.Logger
Parameters:
message -

debug

public void debug(java.lang.String message,
                  java.lang.Throwable t)
This is a log method with logLevel == DEBUG

Specified by:
debug in interface org.apache.turbine.services.logging.Logger
Parameters:
message -
t -

debug

public void debug(java.lang.String message,
                  org.apache.turbine.util.RunData data)
This is a log method with logLevel == DEBUG

Specified by:
debug in interface org.apache.turbine.services.logging.Logger
Parameters:
message -
data -

debug

public void debug(java.lang.String message,
                  org.apache.turbine.util.RunData data,
                  java.lang.Throwable t)
This is a log method with logLevel == DEBUG

Specified by:
debug in interface org.apache.turbine.services.logging.Logger
Parameters:
message -
data -
t -

info

public void info(java.lang.String message)
This is a log method with logLevel == INFO

Specified by:
info in interface org.apache.turbine.services.logging.Logger
Parameters:
message -

info

public void info(java.lang.String message,
                 java.lang.Throwable t)
This is a log method with logLevel == INFO

Specified by:
info in interface org.apache.turbine.services.logging.Logger
Parameters:
message -
t -

info

public void info(java.lang.String message,
                 org.apache.turbine.util.RunData data)
This is a log method with logLevel == INFO

Specified by:
info in interface org.apache.turbine.services.logging.Logger
Parameters:
message -
data -

info

public void info(java.lang.String message,
                 org.apache.turbine.util.RunData data,
                 java.lang.Throwable t)
This is a log method with logLevel == INFO

Specified by:
info in interface org.apache.turbine.services.logging.Logger
Parameters:
message -
data -
t -

warn

public void warn(java.lang.String message)
This is a log method with logLevel == WARN

Specified by:
warn in interface org.apache.turbine.services.logging.Logger
Parameters:
message -

warn

public void warn(java.lang.String message,
                 java.lang.Throwable t)
This is a log method with logLevel == WARN

Specified by:
warn in interface org.apache.turbine.services.logging.Logger
Parameters:
message -
t -

warn

public void warn(java.lang.String message,
                 org.apache.turbine.util.RunData data)
This is a log method with logLevel == WARN

Specified by:
warn in interface org.apache.turbine.services.logging.Logger
Parameters:
message -
data -

warn

public void warn(java.lang.String message,
                 org.apache.turbine.util.RunData data,
                 java.lang.Throwable t)
This is a log method with logLevel == WARN

Specified by:
warn in interface org.apache.turbine.services.logging.Logger
Parameters:
message -
data -
t -

error

public void error(java.lang.String message)
This is a log method with logLevel == ERROR

Specified by:
error in interface org.apache.turbine.services.logging.Logger
Parameters:
message -

error

public void error(java.lang.String message,
                  java.lang.Throwable e)
This is a log method with logLevel == ERROR

Specified by:
error in interface org.apache.turbine.services.logging.Logger
Parameters:
message -
e -

error

public void error(java.lang.Throwable e)
This is a log method with logLevel == ERROR

Specified by:
error in interface org.apache.turbine.services.logging.Logger
Parameters:
e -

error

public void error(java.lang.String message,
                  org.apache.turbine.util.RunData data)
This is a log method with logLevel == ERROR

Specified by:
error in interface org.apache.turbine.services.logging.Logger
Parameters:
message -
data -

error

public void error(java.lang.String message,
                  org.apache.turbine.util.RunData data,
                  java.lang.Throwable e)
This is a log method with logLevel == ERROR

Specified by:
error in interface org.apache.turbine.services.logging.Logger
Parameters:
message -
data -
e -


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.