org.almendra.janet.cas.node
Class Logger

java.lang.Object
  extended by org.almendra.commons.util.logging.Logger
      extended by org.almendra.janet.cas.node.Logger
All Implemented Interfaces:
ILogPrinter

public class Logger
extends Logger


Field Summary
protected  LogEntry defaultValues
          LogEntry has holds the default values that should be copied into any new instance on LogEntry when using the method fillEntryTemplate.
protected static java.lang.String EVENT_EXCEPTION_OCCURRED
           
protected  LocalLoggerDescriptor loggerDescriptor
          Holds information read from the node descriptor xml file where the user specified whether a local log file should be written, what the log file's name is and where it is located.
 
Fields inherited from class org.almendra.commons.util.logging.Logger
bufferUnwrittenMsgs, children, DEBUG, ERROR, EXCEPTION, FATAL, FREE_TEXT, INFO, levelLabels, listeners, localLogFileMaxSize, localLogFileMaxSizeChecked, localLogFileName, localLogWriter, lock, logBuffer, logPrinter, NewSession, parent, registeredEvents, subscribedEvents, WARNING
 
Constructor Summary
Logger()
          Creates a new Logger object.
Logger(boolean bufferUnwrittenMsgs, long localLogFileMaxSize)
          Creates a new Logger object.
Logger(ILogPrinter logPrinter)
          Creates a new Logger object.
Logger(ILogPrinter logPrinter, boolean bufferUnwrittenMsgs)
          Creates a new Logger object.
Logger(LogEntry defaultValuesEntry)
          Creates a new Logger object.
 
Method Summary
 boolean changeLocalLogFileName(java.lang.String nodeName)
           
 void exception(java.lang.Throwable ex)
           
 void fillChildLogger(Logger childLogger)
           
static Logger getChildLogger(Logger logger)
          Returns a child logger.
 LogEntry getDefaultValues()
           
 LocalLoggerDescriptor getLoggerDescriptor()
           
 LogEntry getNewLogEntry()
           
protected  void init()
           
protected  void setDefaultValues(LogEntry defaultValuesEntry)
           
 void setLocalLogFileName(java.lang.String filePathName)
           
 void setLoggerDescriptor(LocalLoggerDescriptor loggerDescriptor)
           
 void setNodeName(java.lang.String nodeName)
          Set the node name for this logger and all it's children since the node name is the same for all loggers of the same node.
 
Methods inherited from class org.almendra.commons.util.logging.Logger
addListener, checkLocalLogMaxSize, close, closeLocalLogWriter, debug, debug, deregisterForEvents, error, error, exception, fatal, fatal, fatalText, freeText, freeText, getChildLogger, getLogEntry, getPublicAccessor, info, info, isRegistered, isSubscribed, log, log, logLocalWriter, openLocalLogWriter, primLog, primReadBuffer, primReadNextLogEntry, readBuffer, registerForEvents, removeListener, removeSubscription, sendToListeners, subscribeForEvents, unsubscribeForEvents, warn, warn, writeBuffer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EVENT_EXCEPTION_OCCURRED

protected static final java.lang.String EVENT_EXCEPTION_OCCURRED
See Also:
Constant Field Values

defaultValues

protected LogEntry defaultValues
LogEntry has holds the default values that should be copied into any new instance on LogEntry when using the method fillEntryTemplate.


loggerDescriptor

protected LocalLoggerDescriptor loggerDescriptor
Holds information read from the node descriptor xml file where the user specified whether a local log file should be written, what the log file's name is and where it is located.

Constructor Detail

Logger

public Logger()
Creates a new Logger object.


Logger

public Logger(boolean bufferUnwrittenMsgs,
              long localLogFileMaxSize)
Creates a new Logger object.


Logger

public Logger(LogEntry defaultValuesEntry)
Creates a new Logger object.

Parameters:
defaultValues - holds default values

Logger

public Logger(ILogPrinter logPrinter)
Creates a new Logger object.


Logger

public Logger(ILogPrinter logPrinter,
              boolean bufferUnwrittenMsgs)
Creates a new Logger object.

Method Detail

fillChildLogger

public void fillChildLogger(Logger childLogger)

getDefaultValues

public LogEntry getDefaultValues()
Returns:
Returns the defaultValues.

setDefaultValues

protected void setDefaultValues(LogEntry defaultValuesEntry)
Parameters:
defaultValues - The defaultValues to set.

getChildLogger

public static Logger getChildLogger(Logger logger)
Returns a child logger. A child logger inherits all the attribute values of the parent logger, but new events can be registered without affecting the parent logger.

Parameters:
logger - the parent logger
Returns:
the child logger

getNewLogEntry

public LogEntry getNewLogEntry()
Overrides:
getNewLogEntry in class Logger
Returns:
Return a new LogEntry object.

setNodeName

public void setNodeName(java.lang.String nodeName)
Set the node name for this logger and all it's children since the node name is the same for all loggers of the same node.

Parameters:
name -

getLoggerDescriptor

public LocalLoggerDescriptor getLoggerDescriptor()
Returns:
Returns the loggerDescriptor.

setLoggerDescriptor

public void setLoggerDescriptor(LocalLoggerDescriptor loggerDescriptor)
Parameters:
loggerDescriptor - The loggerDescriptor to set.

changeLocalLogFileName

public boolean changeLocalLogFileName(java.lang.String nodeName)
                               throws java.io.IOException
Overrides:
changeLocalLogFileName in class Logger
Throws:
java.io.IOException

setLocalLogFileName

public void setLocalLogFileName(java.lang.String filePathName)
                         throws java.io.IOException
Overrides:
setLocalLogFileName in class Logger
Throws:
java.io.IOException

exception

public void exception(java.lang.Throwable ex)

init

protected void init()
Overrides:
init in class Logger