Class 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$, $Date$
    • Constructor Summary

      Constructors 
      Constructor Description
      ConsoleLog()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void flush()
      Flush the system output stream.
      IConfigStore getConfigStore()
      get the configuration store that is associated with this log listener
      java.util.Vector<java.lang.String> 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<java.lang.String> 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<java.lang.String,​java.lang.String> req)
      Retrieve last "maxLine" number of system log with log lever >"level" and from source "source".
      NameValuePairs retrieveLogList​(java.util.Hashtable<java.lang.String,​java.lang.String> 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
      • retrieveLogContent

        public NameValuePairs retrieveLogContent​(java.util.Hashtable<java.lang.String,​java.lang.String> 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<java.lang.String,​java.lang.String> 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<java.lang.String> 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<java.lang.String> 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.