org.objectweb.util.monolog.wrapper.config
Class BasicLogger

java.lang.Object
  extended by org.objectweb.util.monolog.wrapper.config.BasicLogger
All Implemented Interfaces:
Serializable, Handler, Logger, TopicalLogger

public class BasicLogger
extends Object
implements TopicalLogger, Serializable

This class is a basic implementatio of the TopicalLogger interface. It is not linked to any underlying log system. The log methods do nothing. Only the configuration aspect is treated. Therefore all the logger structure is stored into internal struture.

Author:
Sebastien Chassande-Barrioz
See Also:
Serialized Form

Field Summary
protected  HashMap handlers
          This fields references by their name the handlers associated to the logger.
protected  Level level
          The current level of the logger.
protected  LevelFactory levelFactory
          This field references the level factory.
protected  ArrayList topics
          The fields lists all topics the logger.
 
Fields inherited from interface org.objectweb.util.monolog.api.Handler
APPEND_MODE_ATTRIBUTE, BUFFER_ATTRIBUTE, CONSOLE_HANDLER_TYPE, FILE_HANDLER_TYPE, FILE_NUMBER_ATTRIBUTE, GENERIC_HANDLER_TYPE, JMX_HANDLER_TYPE, LEVEL_ATTRIBUTE, LOGGER_HANDLER_TYPE, MAX_SIZE_ATTRIBUTE, OUTPUT_ATTRIBUTE, PATTERN_ATTRIBUTE, ROLLING_FILE_HANDLER_TYPE
 
Method Summary
 void addHandler(Handler h)
           
 void addTopic(String topic)
           
 boolean getAdditivity()
           
 Object getAttribute(String name)
           
 String[] getAttributeNames()
           
 int getCurrentIntLevel()
           
 Level getCurrentLevel()
           
 Handler[] getHandler()
           
 Handler getHandler(String hn)
           
 String getName()
           
 String[] getTopic()
           
 Enumeration getTopics()
          TODO
 String getType()
           
 boolean isLoggable(int level)
           
 boolean isLoggable(Level l)
           
 boolean isOn()
           
 void log(int level, Object message)
           
 void log(int level, Object message, Object location, Object method)
           
 void log(int level, Object message, Throwable throwable)
           
 void log(int level, Object message, Throwable throwable, Object location, Object method)
           
 void log(Level level, Object message)
           
 void log(Level l, Object message, Object location, Object method)
           
 void log(Level level, Object message, Throwable throwable)
           
 void log(Level level, Object message, Throwable throwable, Object location, Object method)
           
 void removeAllHandlers()
           
 void removeHandler(Handler h)
           
 void removeTopic(String topic)
           
 void setAdditivity(boolean a)
           
 Object setAttribute(String name, Object value)
           
 void setIntLevel(int l)
           
 void setLevel(Level l)
           
 void setName(String name)
           
 void turnOff()
           
 void turnOn()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

handlers

protected HashMap handlers
This fields references by their name the handlers associated to the logger. key = a handler name value = a Handler instance


topics

protected ArrayList topics
The fields lists all topics the logger.


levelFactory

protected LevelFactory levelFactory
This field references the level factory.


level

protected Level level
The current level of the logger.

Method Detail

addHandler

public void addHandler(Handler h)
                throws Exception
Specified by:
addHandler in interface TopicalLogger
Throws:
Exception

removeHandler

public void removeHandler(Handler h)
                   throws Exception
Specified by:
removeHandler in interface TopicalLogger
Throws:
Exception

getHandler

public Handler[] getHandler()
Specified by:
getHandler in interface TopicalLogger

getHandler

public Handler getHandler(String hn)
Specified by:
getHandler in interface TopicalLogger

removeAllHandlers

public void removeAllHandlers()
                       throws Exception
Specified by:
removeAllHandlers in interface TopicalLogger
Throws:
Exception

setAdditivity

public void setAdditivity(boolean a)
Specified by:
setAdditivity in interface TopicalLogger

getAdditivity

public boolean getAdditivity()
Specified by:
getAdditivity in interface TopicalLogger

addTopic

public void addTopic(String topic)
              throws Exception
Specified by:
addTopic in interface TopicalLogger
Throws:
Exception

getTopics

public Enumeration getTopics()
TODO

Specified by:
getTopics in interface TopicalLogger

getTopic

public String[] getTopic()
Specified by:
getTopic in interface TopicalLogger

removeTopic

public void removeTopic(String topic)
                 throws Exception
Specified by:
removeTopic in interface TopicalLogger
Throws:
Exception

getName

public String getName()
Specified by:
getName in interface Handler

setName

public void setName(String name)
Specified by:
setName in interface Handler

getType

public String getType()
Specified by:
getType in interface Handler

getAttributeNames

public String[] getAttributeNames()
Specified by:
getAttributeNames in interface Handler

getAttribute

public Object getAttribute(String name)
Specified by:
getAttribute in interface Handler

setAttribute

public Object setAttribute(String name,
                           Object value)
Specified by:
setAttribute in interface Handler

setIntLevel

public void setIntLevel(int l)
Specified by:
setIntLevel in interface Logger

setLevel

public void setLevel(Level l)
Specified by:
setLevel in interface Logger

getCurrentIntLevel

public int getCurrentIntLevel()
Specified by:
getCurrentIntLevel in interface Logger

getCurrentLevel

public Level getCurrentLevel()
Specified by:
getCurrentLevel in interface Logger

isLoggable

public boolean isLoggable(int level)
Specified by:
isLoggable in interface Logger

isLoggable

public boolean isLoggable(Level l)
Specified by:
isLoggable in interface Logger

isOn

public boolean isOn()
Specified by:
isOn in interface Logger

log

public void log(int level,
                Object message)
Specified by:
log in interface Logger

log

public void log(Level level,
                Object message)
Specified by:
log in interface Logger

log

public void log(int level,
                Object message,
                Throwable throwable)
Specified by:
log in interface Logger

log

public void log(Level level,
                Object message,
                Throwable throwable)
Specified by:
log in interface Logger

log

public void log(int level,
                Object message,
                Object location,
                Object method)
Specified by:
log in interface Logger

log

public void log(Level l,
                Object message,
                Object location,
                Object method)
Specified by:
log in interface Logger

log

public void log(int level,
                Object message,
                Throwable throwable,
                Object location,
                Object method)
Specified by:
log in interface Logger

log

public void log(Level level,
                Object message,
                Throwable throwable,
                Object location,
                Object method)
Specified by:
log in interface Logger

turnOn

public void turnOn()
Specified by:
turnOn in interface Logger

turnOff

public void turnOff()
Specified by:
turnOff in interface Logger


Copyright © 2012 OW2 Consortium. All Rights Reserved.