The Process Engine REST Service can be configured
for logging by using Apache log4j.
Logging
configuration is set in a log4j file, with options for specifying
logging behavior, priority levels, and output formats. A sample log4j
configuration file is included with the Content Platform Engine installation.
To configure logging for the Process Engine REST API:
- From Content Platform Engine installation,
copy the /install_path/IBM/FileNet/ContentEngine/tools/PE/samples/fnlog4j.properties.sample file.
- Place the file in the jre/lib directory
of the application server where the client is deployed.
If
the client is deployed on WebSphere® Application
Server,
the following table shows the default path for the jre/lib directory.
Operating system |
Default file path |
AIX® |
/usr/IBM/WebSphere/AppServer/java/jre/lib |
Linux |
/opt/IBM/WebSphere/AppServer/java/jre/lib |
Linux for System z |
/opt/IBM/WebSphere/AppServer/java/jre/lib |
Windows |
drive:\Program Files (x86)\IBM\WebSphere\AppServer\java\jre\lib\ |
If the client is deployed on Oracle WebLogic Server, the location of the jre/lib directory
depends on the JRE that WebLogic Server is configured
to use. Some examples of JREs are Oracle JRockit, Sun, or IBM JRE. For the JRockit
JRE, a typical path for the fnlog4j.properties file
might be /usr/Oracle/Middleware/bea/jrockit_version/jre/lib/.
- Rename the file to fnlog4j.properties.
- Using the following example as a guide, edit the fnlog4j.properties file
to specify your preferred logging level.
# for tracking REST accesses------------------------------------------
log4j.appender.REST=org.apache.log4j.DailyRollingFileAppender
log4j.appender.REST.layout=org.apache.log4j.PatternLayout
log4j.appender.REST.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss} [%t] %m%n
log4j.appender.REST.File=c:\\RESTLog.txt
log4j.appender.REST.Append=true
# ---------- filenet.pe.rest.* loggers---------
log4j.logger.filenet.pe.rest=DEBUG,TXT
#--------------------------------------------------
log4j.logger.filenet.pe.rest.servlet=DEBUG
log4j.logger.filenet.pe.rest.request=DEBUG
log4j.logger.filenet.pe.rest.response=DEBUG
log4j.logger.filenet.pe.rest.handler=DEBUG
log4j.logger.filenet.pe.rest.utils=DEBUG
log4j.logger.filenet.pe.rest.auditTrail=INFO,REST
- Save the updated fnlog4j.properties file.
If the file is in the correct jre/lib directory,
logging is automatically enabled. You do not need to restart the client
application or the application server.