iiitToolkit 1.0

de.iiit.util
Class LogUtil

java.lang.Object
  |
  +--de.iiit.util.LogUtil

public class LogUtil
extends Object

This class includes some methods to initialize a Log4J Logger

Version:
$Revision: 1.12 $ $Date: 2003/04/02 09:25:53 $

Constructor Summary
LogUtil()
           
 
Method Summary
static void init()
          Initializes the Logger to log all messages with an log-level of DEBUB or higher.
static void init(Configuration config)
          Uses a Configuration block to configure and initialize the Logger These Attributes are read from the configuration:
LogLevel - log all messages of this level or higher
LogLayout - use this layout string, defaults to "%d [%t] %-5p %c{1} - * %m%n"
LogFile - the full pathname of the log file to write
MaxFileSize - the maximum file size of the log file, default: 1,000,000 Bytes
MaxBackupFiles - the number of old log files to save, default: 5
static void init(Configuration config, Level defaultLevel)
          Uses a Configuration block to configure and initialize the Logger These Attributes are read from the configuration:
LogLevel - log all messages of this level or higher
LogLayout - use this layout string, defaults to "%d [%t] %-5p %c{1} - * %m%n"
LogFile - the full pathname of the log file to write
MaxFileSize - the maximum file size of the log file, default: 1,000,000 Bytes
MaxBackupFiles - the number of old log files to save, default: 5
static void init(Level level)
          Initializes the Logger to log all messages with an log-level of level or higher.
static void init(Level level, String filename)
          Initializes the Logger to log all messages with an log-level of level or higher.
static void init(Level level, String filename, int maxFileSize, int maxBackupFiles)
          Initializes the Logger to log all messages with an log-level of level or higher.
static void init(String level, Level defaultLevel)
          Initializes the Logger to log all messages with an log-level of level or higher.
static void init(String level, String filename)
          Initializes the Logger to log all messages with an log-level of level or higher.
static void init(String level, String filename, int maxFileSize, int maxBackupFiles)
          Initializes the Logger to log all messages with an log-level of level or higher.
static boolean loggerIsInitialized()
          Retrieve if the Logger is already initialized.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogUtil

public LogUtil()
Method Detail

loggerIsInitialized

public static final boolean loggerIsInitialized()
Retrieve if the Logger is already initialized.

Returns:
true if the Logger is initialized or false if not.

init

public static final void init(Level level)
Initializes the Logger to log all messages with an log-level of level or higher. The output is directed to STDOUT.

Parameters:
level - log all messages of this level or higher

init

public static final void init(String level,
                              Level defaultLevel)
Initializes the Logger to log all messages with an log-level of level or higher. The output is directed to STDOUT.

Parameters:
level - log all messages with a log-level named level or higher.
defaultLevel - use this level as default if the level name can not be parsed.

init

public static final void init(Level level,
                              String filename,
                              int maxFileSize,
                              int maxBackupFiles)
Initializes the Logger to log all messages with an log-level of level or higher. The output is directed to a file.

Parameters:
level - log all messages of this level or higher
filename - the name of the file to send the log messages to. If it is null or empty System.out will be used.
maxFileSize - the maximum file size of the log file
maxBackupFiles - the number of old log files to save

init

public static final void init(String level,
                              String filename,
                              int maxFileSize,
                              int maxBackupFiles)
Initializes the Logger to log all messages with an log-level of level or higher. The output is directed to a file.

Parameters:
level - log all messages of this level or higher
filename - the name of the file to send the log messages to. If it is null or empty System.out will be used.
maxFileSize - the maximum file size of the log file
maxBackupFiles - the number of old log files to save

init

public static final void init(Level level,
                              String filename)
Initializes the Logger to log all messages with an log-level of level or higher. The output is directed to a file. The maximum filesize is set to 1,000,000 and a maximum of five old files is saved.

Parameters:
level - log all messages of this level or higher
filename - the name of the file to send the log messages to. If it is null or empty System.out will be used.

init

public static final void init(String level,
                              String filename)
Initializes the Logger to log all messages with an log-level of level or higher. The output is directed to a file. The maximum filesize is set to 1,000,000 and a maximum of five old files is saved.

Parameters:
level - log all messages of this level or higher
filename - the name of the file to send the log messages to. If it is null or empty System.out will be used.

init

public static final void init(Configuration config,
                              Level defaultLevel)
Uses a Configuration block to configure and initialize the Logger These Attributes are read from the configuration:
LogLevel - log all messages of this level or higher
LogLayout - use this layout string, defaults to "%d [%t] %-5p %c{1} - * %m%n"
LogFile - the full pathname of the log file to write
MaxFileSize - the maximum file size of the log file, default: 1,000,000 Bytes
MaxBackupFiles - the number of old log files to save, default: 5

Parameters:
config - the configuration block to read.
defaultLevel - use this log level as default

init

public static final void init(Configuration config)
Uses a Configuration block to configure and initialize the Logger These Attributes are read from the configuration:
LogLevel - log all messages of this level or higher
LogLayout - use this layout string, defaults to "%d [%t] %-5p %c{1} - * %m%n"
LogFile - the full pathname of the log file to write
MaxFileSize - the maximum file size of the log file, default: 1,000,000 Bytes
MaxBackupFiles - the number of old log files to save, default: 5

Parameters:
config - the configuration block to read.

init

public static final void init()
Initializes the Logger to log all messages with an log-level of DEBUB or higher. The output is directed to STDOUT.


iiitToolkit 1.0

Copyright © 2002, 2003 ingeneurbuero fuer innovative informationstechnik, Dipl.-Ing. Joerg Beckmann, Dortmund, Germany. All Rights Reserved.
See Copyright statement