com.netscape.certsrv.logging
Class ConsoleLog

java.lang.Object
  extended by com.netscape.certsrv.logging.ConsoleLog
All Implemented Interfaces:
ILogEventListener, java.util.EventListener

public class ConsoleLog
extends java.lang.Object
implements ILogEventListener

A log event listener which sends all log events to the system console/tty

Version:
$Revision: 1211 $, $Date: 2010-08-18 10:15:37 -0700 (Wed, 18 Aug 2010) $

Constructor Summary
ConsoleLog()
           
 
Method Summary
 void flush()
          Flush the system output stream.
 IConfigStore getConfigStore()
          get the configuration store that is associated with this log listener
 java.util.Vector getDefaultParams()
          Return list of default config parameters for this log event listener.
 java.lang.String getDescription()
          Returns the description of this log event listener.
 java.lang.String getImplName()
          Returns implementation name.
 java.util.Vector getInstanceParams()
          Return list of instance config parameters for this log event listener.
 void init(ISubsystem owner, IConfigStore config)
          Initialize this log listener
 void log(ILogEvent ev)
          Log the given event.
 NameValuePairs retrieveLogContent(java.util.Hashtable req)
          Retrieve last "maxLine" number of system log with log lever >"level" and from source "source".
 NameValuePairs retrieveLogList(java.util.Hashtable req)
          Retrieve log file list.
 void shutdown()
          All operations need to be cleaned up for shutdown are done here
 void startup()
          Startup the instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConsoleLog

public ConsoleLog()
Method Detail

log

public void log(ILogEvent ev)
Log the given event. Usually called from a log manager.

Specified by:
log in interface ILogEventListener
Parameters:
ev - log event

flush

public void flush()
Flush the system output stream.

Specified by:
flush in interface ILogEventListener

shutdown

public void shutdown()
All operations need to be cleaned up for shutdown are done here

Specified by:
shutdown in interface ILogEventListener

getConfigStore

public IConfigStore getConfigStore()
get the configuration store that is associated with this log listener

Specified by:
getConfigStore in interface ILogEventListener
Returns:
the configuration store that is associated with this log listener

init

public void init(ISubsystem owner,
                 IConfigStore config)
          throws EBaseException
Description copied from interface: ILogEventListener
Initialize this log listener

Specified by:
init in interface ILogEventListener
Parameters:
owner - The subsystem.
config - Configuration store for this log listener.
Throws:
EBaseException

startup

public void startup()
             throws EBaseException
Description copied from interface: ILogEventListener
Startup the instance.

Specified by:
startup in interface ILogEventListener
Throws:
EBaseException

retrieveLogContent

public NameValuePairs retrieveLogContent(java.util.Hashtable req)
                                  throws javax.servlet.ServletException,
                                         java.io.IOException,
                                         EBaseException
Retrieve last "maxLine" number of system log with log lever >"level" and from source "source". If the parameter is omitted. All entries are sent back.

Specified by:
retrieveLogContent in interface ILogEventListener
Parameters:
req - a Hashtable containing the required information such as log entry, log level, log source, and log name
Returns:
the content of the log that match the criteria in req
Throws:
servletException
java.io.IOException
EBaseException
javax.servlet.ServletException - For Servelet errros.

retrieveLogList

public NameValuePairs retrieveLogList(java.util.Hashtable req)
                               throws javax.servlet.ServletException,
                                      java.io.IOException,
                                      EBaseException
Retrieve log file list.
unimplemented

Specified by:
retrieveLogList in interface ILogEventListener
Throws:
javax.servlet.ServletException
java.io.IOException
EBaseException

getImplName

public java.lang.String getImplName()
Description copied from interface: ILogEventListener
Returns implementation name.

Specified by:
getImplName in interface ILogEventListener
Returns:
String name of event listener implementation.

getDescription

public java.lang.String getDescription()
Description copied from interface: ILogEventListener
Returns the description of this log event listener.

Specified by:
getDescription in interface ILogEventListener
Returns:
String with listener description.

getDefaultParams

public java.util.Vector getDefaultParams()
Description copied from interface: ILogEventListener
Return list of default config parameters for this log event listener.

Specified by:
getDefaultParams in interface ILogEventListener
Returns:
Vector of default parameters.

getInstanceParams

public java.util.Vector getInstanceParams()
Description copied from interface: ILogEventListener
Return list of instance config parameters for this log event listener.

Specified by:
getInstanceParams in interface ILogEventListener
Returns:
Vector of instance parameters.