com.isti.util
Class IstiLogFileHandler

java.lang.Object
  extended by java.util.logging.Handler
      extended by com.isti.util.IstiLogFileHandler

public class IstiLogFileHandler
extends java.util.logging.Handler

Class IstiLogFileHandler is a Java logging Handler that publishes its messages into an ISTI LogFile object. Logging levels are converted.


Field Summary
protected  LogFile istiLogObj
          Target ISTI LogFile object.
protected static java.util.HashMap levelXlatTable
          Translation table, Java Logger levels to ISTI LogFile levels.
 
Constructor Summary
IstiLogFileHandler(LogFile lObj)
          Creates a Java logging Handler that publishes its messages into an ISTI LogFile object.
 
Method Summary
 void close()
          Close the Handler.
 void flush()
          Flush any buffered output.
static java.util.logging.Level levelFromIstiLevel(int levelVal)
          Converts the given ISTI LogFile level value to the corresponding Java-logging 'Level' object.
static int levelToIstiLevel(java.util.logging.Level levelObj)
          Converts the given Java-logging 'Level' object to the corresponding ISTI LogFile level value.
 void publish(java.util.logging.LogRecord recObj)
          Publishes the given message into the ISTI LogFile object.
 
Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

istiLogObj

protected final LogFile istiLogObj
Target ISTI LogFile object.


levelXlatTable

protected static final java.util.HashMap levelXlatTable
Translation table, Java Logger levels to ISTI LogFile levels.

Constructor Detail

IstiLogFileHandler

public IstiLogFileHandler(LogFile lObj)
Creates a Java logging Handler that publishes its messages into an ISTI LogFile object.

Parameters:
lObj - target ISTI LogFile object.
Method Detail

publish

public void publish(java.util.logging.LogRecord recObj)
Publishes the given message into the ISTI LogFile object.

Specified by:
publish in class java.util.logging.Handler
Parameters:
recObj - log record to be published, or null for no action.

flush

public void flush()
Flush any buffered output. Performs no action in this class.

Specified by:
flush in class java.util.logging.Handler

close

public void close()
Close the Handler. Performs no action in this class.

Specified by:
close in class java.util.logging.Handler

levelToIstiLevel

public static int levelToIstiLevel(java.util.logging.Level levelObj)
Converts the given Java-logging 'Level' object to the corresponding ISTI LogFile level value.

Parameters:
levelObj - Java-logging 'Level' object to be converted.
Returns:
An ISTI LogFile level value.

levelFromIstiLevel

public static java.util.logging.Level levelFromIstiLevel(int levelVal)
Converts the given ISTI LogFile level value to the corresponding Java-logging 'Level' object.

Parameters:
levelVal - the ISTI LogFile level value to be converted.
Returns:
A Java-logging 'Level' object, or null if the given value could not be matched.