Logging

Workplace uses the Apache log4j product to manage its logging. All Workplace errors, warnings, failures and exceptions are logged by default and available to administrators and users. They are also written in Common Base Event (CBE) format to a second log making it possible for further analysis by IBM diagnostic tools. Support and development personnel use the information in log entries to analyze application activity as well as diagnose and solve problems. Logging is for diagnostic purposes only and does not provide security or audit trail information.

The configuration file is checked every minute for any changes by Workplace; therefore you can update the configuration file settings at any time via an editor.

Logging files

The logging files available in the configuration file are the Workplace logger, filenet-IBMCommon logger, and com.filenet logger, which is the subcomponent logger. Two log files are created for each logger file via two appenders. One appender creates the CBE file and the other creates a simple formatted log file. The main parameter that can be set on the Workplace logger for the CBE file is level and it is set on the following line of the filenet-IBMCommon logger:

log4j.logger.com.filenet-IBMcommon=INFO, CommonOutputFile, nCommonOutputFile

Logging level

The logging level you specify determines the type and amount of information collected. A direct correlation exists between the amount of information collected and the performance impact on the system.

The Workplace application log supports standard INFO, WARN, ERROR, and FATAL levels. The following table briefly describes the standard levels; see your Apache log4j documentation for more information about levels. The other parameters that might also be useful are: local for localization, file location, file size, and number of backups. The other defaults should not be changed without some knowledge of the log4j configuration.

Level Description
INFO Requests informational messages that describe the progress of the application at a coarse-grained level.
WARN Requests logging for potentially harmful situations.
ERROR Requests logging exceptions thrown from within the application.
FATAL Requests logging for only very severe error events that can presumably lead to application failure.

The subcomponent log level can be set to WARN in the following line of the com.filenet logger:

log4j.logger.com.filenet=WARN, ErrorOutputFile, nErrorOutputFile

Setting it to INFO provides an overwhelming amount of information. The other parameter for this logger can be set in a similar fashion.

log4j.properties file example

The following content is an example of the log4j.properties file:

#
# Workplace Log4j Configuration
#

#
# LoggerName: rootLogger
# Description: parent of all other loggers, this is where the global
# default settings which are inherited by other loggers
# are placed.
# notes:configure the rootLogger level to display only messages
# of ERROR level or greater and send them to the NT Event Log
log4j.rootLogger=ERROR

#
# LoggerName: com.filenet
# Description: This logger produces the log for the subcomponents used by Workplace.
# It will log to separate files from the com.filenet-IBMcommon logger and be set to WARN instead
# of INFO by default since INFO is very verbose in the sub components and not yet
# compliant with the IBM standards.
log4j.logger.com.filenet=WARN, ErrorOutputFile, nErrorOutputFile
log4j.appender.ErrorOutputFile=org.apache.log4j.RollingFileAppender
log4j.appender.ErrorOutputFile.layout=org.apache.log4j.PatternLayout
log4j.appender.ErrorOutputFile.layout.ConversionPattern=%d{ISO8601} %-5p [%15.15t] %F:%L %c{1}:%M() - %m%n
log4j.appender.ErrorOutputFile.File=C:\\Program Files\\FileNet\\AE\\Logs\\p8WorkplaceSub.log
log4j.appender.ErrorOutputFile.MaxFileSize=10MB
log4j.appender.ErrorOutputFile.MaxBackupIndex=2
log4j.appender.nErrorOutputFile=org.apache.log4j.RollingFileAppender
log4j.appender.nErrorOutputFile.layout=com.filenet.log4CBE.CBELayout
log4j.appender.nErrorOutputFile.layout.ProductName=IBM FileNet P8 AE
log4j.appender.nErrorOutputFile.layout.Locale=en-US
log4j.appender.nErrorOutputFile.File=C:\\Program Files\\FileNet\\AE\\Logs\\p8WorkplaceSubCBE.log
log4j.appender.nErrorOutputFile.MaxFileSize=10MB
log4j.appender.nErrorOutputFile.MaxBackupIndex=2

#
# LoggerName: com.filenet-IBMcommon
# Description: root of the commonLogger this logger is set to INFO level by default.
# levels: INFO – any info
# WARN – warning messages or exceptions
# ERROR – all error exceptions
# FATAL – fatal errors
log4j.logger.com.filenet-IBMcommon=INFO, CommonOutputFile, nCommonOutputFile

# The appender for the CBE logging
log4j.appender.CommonOutputFile=org.apache.log4j.RollingFileAppender

# The CBE layout class
log4j.appender.CommonOutputFile.layout=com.filenet.log4CBE.CBELayout

# the product name
log4j.appender.CommonOutputFile.layout.ProductName=IBM FileNet P8 AE

# the local
log4j.appender.CommonOutputFile.layout.Locale=en-US

# MDCKeys with on key SesseionID
log4j.appender.CommonOutputFile.layout.MDCkeys=SessionID,Deployment

#The absolute location of the log file
log4j.appender.CommonOutputFile.File= C:\\Program Files\\FileNet\\AE\\Logs\\p8WorkplaceCBE.log

#max file size
log4j.appender.CommonOutputFile.MaxFileSize=10MB

#max number of backups
log4j.appender.CommonOutputFile.MaxBackupIndex=2

#normal log4j appender
log4j.appender.nCommonOutputFile=org.apache.log4j.RollingFileAppender
log4j.appender.nCommonOutputFile.layout=org.apache.log4j.PatternLayout
log4j.appender.nCommonOutputFile.layout.ConversionPattern=%d{ISO8601} %-5p [%15.15t] %F:%L %c{1}:%M() - %m%n
log4j.appender.nCommonOutputFile.File= C:\\Program Files\\FileNet\\AE\\Logs\\p8Workplace.log
log4j.appender.nCommonOutputFile.MaxFileSize=10MB
log4j.appender.nCommonOutputFile.MaxBackupIndex=2



Feedback

© Copyright IBM Corporation 2013.
This information center is powered by Eclipse technology. (http://www.eclipse.org)