internalInformationPort
Class LogFileGenerator

java.lang.Object
  extended by internalInformationPort.LogFileGenerator

final class LogFileGenerator
extends java.lang.Object

Logs and/or displays messages depending on the message's Level, this logger's DISPLAY_LEVEL and this logger's LOG_LEVEL (which are defined in the property file).

For a detailed explanation of the different levels see http://java.sun.com/j2se/1.4.2/docs/api/java/util/logging/Level.html .

Author:
Karl-Peter Fuchs

Nested Class Summary
private static class LogFileGenerator.LocalFormatter
          Formatter used to format log file entries.
 
Field Summary
private static int displayLevel
          Displaying level that can be used to control displaying output.
private static java.util.logging.Logger logger
          Logger object used to log messages.
private static java.util.logging.Level logLevel
          Logging level that can be used to control logging output.
 
Constructor Summary
private LogFileGenerator()
          Empty constructor.
 
Method Summary
protected static java.util.logging.Logger getLogger()
          Returns the Logger used by this class.
private static void initializeLogFile(java.util.logging.Formatter formatter)
          Generates a log file using the bypassed Formatter.
protected static void log(java.util.logging.Level level, java.lang.String message)
          Logs/displays the bypassed message if the bypassed Level is higher than this logger's level(s) (displayLevel and logLevel).
private static void readValuesFromPorpertyFile()
          Loads LOG_LEVEL and DISPLAY_LEVEL from property file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static java.util.logging.Logger logger
Logger object used to log messages.


logLevel

private static java.util.logging.Level logLevel
Logging level that can be used to control logging output.


displayLevel

private static int displayLevel
Displaying level that can be used to control displaying output.

Constructor Detail

LogFileGenerator

private LogFileGenerator()
Empty constructor. Never used since all methods are static.

Method Detail

getLogger

protected static java.util.logging.Logger getLogger()
Returns the Logger used by this class.

Returns:
Logger used by this class.

log

protected static void log(java.util.logging.Level level,
                          java.lang.String message)
Logs/displays the bypassed message if the bypassed Level is higher than this logger's level(s) (displayLevel and logLevel).

Parameters:
level - Level of the bypassed message.
message - The message to be logged/displayed.

initializeLogFile

private static void initializeLogFile(java.util.logging.Formatter formatter)
Generates a log file using the bypassed Formatter.

Generates a filename using the actual date and time and writes information about the mix (this LogFileGenerator belongs to) into the corresponding file.

Parameters:
formatter - Formatter for log file entries.

readValuesFromPorpertyFile

private static void readValuesFromPorpertyFile()
Loads LOG_LEVEL and DISPLAY_LEVEL from property file.

See Also:
logLevel, displayLevel