org.opensubsystems.core.util
Class Log

java.lang.Object
  extended by org.opensubsystems.core.util.Log

public class Log
extends java.lang.Object

Class responsible for instantiating of the system logger. This way anybody can use this default logger to output their log messages without worrying what logger to use.

Version:
$Id: Log.java,v 1.9 2007/01/07 06:14:00 bastafidli Exp $
Author:
Miro Halas
Code reviewer:
Miro Halas
Code reviewed:
1.5 2006/04/05 05:05:38 bastafidli

Field Summary
static java.lang.String DEFAULT_LOGCONFIG_FILE_NAME
          Default file name of configuration file.
static java.lang.String DEFAULT_LOGGER_NAME
          Name of the default logger.
protected static java.util.logging.Logger s_lgLogger
          Default Java logger to log messages to the application.
protected static java.util.logging.Logger s_logger
          Logger for this class.
protected static java.lang.String s_strConfigFile
          Name of the configuration file actually used to configure the logger.
protected static java.lang.String s_strMutex
          Helper mutex to synchronize some methods.
 
Constructor Summary
protected Log()
          Hidden constructor to disable creation of instances of this class.
 
Method Summary
protected static java.io.InputStream findConfigFile(java.lang.String strConfigFileName)
          Find and configuration file.
static java.util.logging.Logger getInstance()
          Deprecated.  
static java.util.logging.Logger getInstance(java.lang.Class classIdentifier)
          Get instance of configured logger which can be used to log messages from the application.
static java.util.logging.Logger getInstance(java.lang.String logIdentifier)
          Get instance of configured logger which can be used to log messages from the application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_LOGGER_NAME

public static final java.lang.String DEFAULT_LOGGER_NAME
Name of the default logger. Name it by the root package.

See Also:
Constant Field Values

DEFAULT_LOGCONFIG_FILE_NAME

public static final java.lang.String DEFAULT_LOGCONFIG_FILE_NAME
Default file name of configuration file.

See Also:
Constant Field Values

s_lgLogger

protected static transient java.util.logging.Logger s_lgLogger
Default Java logger to log messages to the application.


s_strMutex

protected static transient java.lang.String s_strMutex
Helper mutex to synchronize some methods.


s_strConfigFile

protected static java.lang.String s_strConfigFile
Name of the configuration file actually used to configure the logger.


s_logger

protected static java.util.logging.Logger s_logger
Logger for this class. It will be initialized only after the log configuration is initialized.

Constructor Detail

Log

protected Log()
Hidden constructor to disable creation of instances of this class.

Method Detail

getInstance

public static java.util.logging.Logger getInstance()
Deprecated. 

Get instance of configured logger which can be used to log messages from the application.

Returns:
Logger - instance of logger ready to use

getInstance

public static java.util.logging.Logger getInstance(java.lang.Class classIdentifier)
Get instance of configured logger which can be used to log messages from the application.

Parameters:
classIdentifier - - identifier of class to get the logger for
Returns:
Logger - instance of logger ready to use

getInstance

public static java.util.logging.Logger getInstance(java.lang.String logIdentifier)
Get instance of configured logger which can be used to log messages from the application.

Parameters:
logIdentifier - - identifier of log to get
Returns:
Logger - instance of logger ready to use

findConfigFile

protected static java.io.InputStream findConfigFile(java.lang.String strConfigFileName)
                                             throws java.io.IOException,
                                                    java.io.FileNotFoundException
Find and configuration file.

Parameters:
strConfigFileName - - name of the configuration file
Returns:
InputStream - opened config file
Throws:
java.io.IOException - - an error has occured opening configuration file
java.io.FileNotFoundException - - file cannot be found


Copyright © 2003 - 2006 OpenSubsystems s.r.o.