uk.ac.ic.doc.automed.util
Class LogOutputHandler

java.lang.Object
  extended by uk.ac.ic.doc.automed.util.LogOutputHandler

public class LogOutputHandler
extends java.lang.Object

LogOutputHandler.java

Author:
Duc M Le dmle@doc.ic.ac.uk Created on 01 August 2006 Department of Computing, Imperial College

Field Summary
static int CONSOLE
          Print log messages to std output only
static java.lang.String ERROR_LOG_FILE
           
static int FILE
          Print log messages to file
static java.lang.String LOG_FILE
           
static int REMOTE
          Print log messages to a log server
 
Constructor Summary
LogOutputHandler(int handlerType)
          Creates a new instance of LogHandler Set default value of append to true
LogOutputHandler(int handlerType, boolean append)
          Creates a new instance of LogHandler
 
Method Summary
protected  int getHandlerType()
          return the log handler type
static void main(java.lang.String[] args)
           
 void output(java.lang.String[] logElements)
          Write log message to normal log file.
 void outputError(java.lang.String[] logElements, java.lang.Throwable t)
          Write errors to error log file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONSOLE

public static final int CONSOLE
Print log messages to std output only

See Also:
Constant Field Values

FILE

public static final int FILE
Print log messages to file

See Also:
Constant Field Values

REMOTE

public static final int REMOTE
Print log messages to a log server

See Also:
Constant Field Values

LOG_FILE

public static final java.lang.String LOG_FILE

ERROR_LOG_FILE

public static final java.lang.String ERROR_LOG_FILE
Constructor Detail

LogOutputHandler

public LogOutputHandler(int handlerType)
Creates a new instance of LogHandler Set default value of append to true


LogOutputHandler

public LogOutputHandler(int handlerType,
                        boolean append)
Creates a new instance of LogHandler

Method Detail

output

public void output(java.lang.String[] logElements)
Write log message to normal log file. It also monitors the file's growth.


outputError

public void outputError(java.lang.String[] logElements,
                        java.lang.Throwable t)
Write errors to error log file. It also monitors the file's growth.


getHandlerType

protected int getHandlerType()
return the log handler type


main

public static void main(java.lang.String[] args)