Logging Configuration

## 6 Logging Configuration

The APIs are structured so that an initial set of configuration information is read as properties from a configuration file named “CommonLogging.properties” - This logging configuration file is in standard java.util.Properties format. The configuration information may then be changed programmatically by calls on the various logging classes and objects.
By default the CommonLogging.properties file is located in the /etc directory, however, when running an application may specify another location using the property “com.hp.mw.common.util.logging.propertiesFile”. If the configuration file cannot be found default properties or those defined with the –D option are considered as illustrated previously in some scenarios.

#### Warning

If the CommonLogging.properties file is present, any property specified with –D is not considered.
If the default properties file, CommonLogging.properties, is used, the directory in which it resides shall appear in the CLASSPATH.

#### Default Configuration

# This CommonLogging.properties, used to configure a set of properties # used by the common logging framework is located by default in the /etc # directory. # The configuration file can be changed using the java -D option as follow # java -Dcom.hp.mw.common.util.logging.propertiesFile=<config_file> Application_class #======================================================================== # Any Logger created by the Logger Factory is by default enabled. # To disable logging requests the following property shall be set to YES #com.hp.mw.common.utils.logging.log.disabled=NO #======================================================================== # Any Logger created by the Logger Factory is by default set to the DEBUG # Level. The following property allows to modify it default level. # Possible Values are: DEBUG, INFO, WARN, ERROR, FATAL # If com.hp.mw.common.utils.logging.disabled is set to YES, logging # requests are discarded whatever the value assigned to # com.hp.mw.common.utils.logging.log.level #com.hp.mw.common.utils.logging.log.level= #======================================================================== # The locale language chosen by the aplication # By default the language is set to en_US (language=en and country=US) #com.hp.mw.common.utils.logging.language=fr #com.hp.mw.common.utils.logging.country=FR #======================================================================== # The name of the underlying logging service to use. # Th default is the HP logging mechanism used by CSF # Possible Values are: # - "com.hp.mwlabs.common.util.logging.simpleLog.ArjSimpleLoggerFactory" # - "com.hp.mwlabs.common.util.logging.csf.ArjChannelFactory" # - "com.hp.mwlabs.common.util.logging.log4j.ArjLoggerFactory" : The default #com.hp.mw.common.utils.logging.factory=com.hp.mwlabs.common.util.logging.csf.ArjChannelFactory #com.hp.mw.common.utils.logging.factory=com.hp.mwlabs.common.util.logging.log4j.ArjLoggerFactory #com.hp.mw.common.utils.logging.factory=com.hp.mwlabs.common.util.logging.simpleLog.ArjSimpleLoggerFactory #======================================================================== # If the Common Logging Framework is used with the HP CSF logging, the creation of a # Handler object (in CSF terms) and its registration with the LogHandlerFactory should # be avoided. Rather, the Handler created by CSF should be used by the Common Logging Framework. # Then set inscsf=YES - default is NO #com.hp.mw.common.utils.logging.incsf=NO #======================================================================== # The output considered to forward log meesages # by default log messages are sent to the console # Possibles values are: # - "console" : the Default - logging requests are sent to the console # - "file" : logging requests are sent to a file. The name of the file and it's location # are well defined unless modified as described via properties described below. # - "config_key": This value means that the underlying logging tool will setup the way loggers are # via a well known configuration file described as a Java properties file. # - "config_xml": This value means that the underlying logging tool will setup the way loggers are # via a well known XML configuration file. #com.hp.mw.common.utils.logging.output= #======================================================================== # The name given to the output file. # Used if output=file # By the default the outputfile name is loggingFile.log, however, the way # the name is used in HP CSF logging and LOG4j is different. # - Log4j: # The Default name given for the output file is "loggingFile", # which can be changed by the <file_name> if provided. # - CSF Log # The Default name given for the output file is loggingFile.log. # - The property "logfile" is the name of file to log # - The property "logdir" is the name of the directory where he log file # is stored. The default is the current directory #com.hp.mw.common.utils.logging.log.file= #com.hp.mw.common.utils.logging.log.dir= #======================================================================== # Specify if a finer debugging granularity should be provided by the # Logger. # By default the granularity extention is not provided and is set to "NO" # If you set YES, you should provide finer debugging classes #com.hp.mw.common.utils.logging.FinerDebug=YES #======================================================================== # If the DebugExtention is set to "YES", finer debugging classes should be provided # via the following properties # - com.hp.mw.common.utils.logging.dClass is the name (with complete path) of the class # implementing the DebugLevel interface # - com.hp.mw.common.utils.logging.fClass is the name (with complete path) of the class # implementing the FacilityCode interface # - com.hp.mw.common.utils.logging.vClass is the name (with complete path) of the class # implementing the VisibilityLevel interface # # If one or all finer classes are not provided by the application, default finer classes # are used as described below. #com.hp.mw.common.utils.logging.dClass=com.hp.mw.common.util.logging.CommonDebugLevel #com.hp.mw.common.utils.logging.fClass=com.hp.mw.common.util.logging.CommonFacilityCode #com.hp.mw.common.utils.logging.vClass=com.hp.mw.common.util.logging.CommonVisibilityLevel #========================================================================= # If Finer debugging classes are provided, the following properties define # default Finer debugging values a commonLogger should have. These values shall # be defined in finer debugging classes provided as described above. # Default values assigned for the Logger are: # - For debuggingLevel # CommonDebugLevel.NO_DEBUGGING - The value (long) is : 0 # Possible values provided by com.hp.mw.common.util.logging.CommonDebugLevel are: # NO_DEBUGGING # CONSTRUCTORS # DESTRUCTORS # CONSTRUCT_AND_DESTRUCT = CONSTRUCTORS | DESTRUCTORS; # FUNCTIONS # OPERATORS # FUNCS_AND_OPS = FUNCTIONS | OPERATORS; # ALL_NON_TRIVIAL = CONSTRUCT_AND_DESTRUCT | FUNCTIONS | OPERATORS; # TRIVIAL_FUNCS # TRIVIAL_OPERATORS # ALL_TRIVIAL = TRIVIAL_FUNCS | TRIVIAL_OPERATORS; # ERROR_MESSAGES # FULL_DEBUGGING # - For FacilityCode # CommonFacilityCode.FAC_ALL - The value (long) is : 0xffffffff # Possible values provided by com.hp.mw.common.util.logging.CommonFacilityCode are: # FAC_NONE # FAC_ALL # - For VisibilityLevel # CommonVisibilityLevel.VIS_ALL - The value (long) is : 0xffffffff # Possible values provided by com.hp.mw.common.util.logging.CommonVisibilityLevel are: # VIS_NONE # VIS_PRIVATE # VIS_PROTECTED # VIS_PUBLIC # VIS_PACKAGE # VIS_ALL #com.hp.mw.common.utils.logging.debugValue=NO_DEBUGGING #com.hp.mw.common.utils.logging.facilValue=FAC_ALL #com.hp.mw.common.utils.logging.visibValue=VIS_ALL

#### Configuring the Underlying Logging System

The user is totally responsible for the configuration of the underlying logging system. The Common Logging Framework does not change existing configuration.

Each individual logging implementation may support its own configuration properties. These should be documented in the class descriptions for the corresponding implementation class.

Main Previous