Developers can use the Java™ and
Apache logging services to control message levels and runtime formats
and storage.
Rule Execution Server
uses standard Java logging services:
- Java logger
- The java.util.logging package.
For more information about the API, see the Sun
Developer Center.
- Java EE Connector Architecture (JCA)
- For more information, see the Sun
Developer Center.
- Apache log4j
- For more information about the API, see Apache Logging Services.
Using these logging services, developers can log messages
that are based on message type and level. They can also control how
these messages are formatted and stored at run time.
The following table lists the loggers that are used by each Rule Execution Server component.
Table 1. Loggers for each
Rule Execution Server
componentModule Component |
Logger |
Execution unit (XU) |
Rule Execution Server uses
the Java logger. The other supported
application servers use the logging service of the Java connector architecture (JCA). |
Hosted transparent decision services |
Apache log4j |
Rule Execution Server console |
Apache log4j |
Decision Warehouse |
No logger. Decision Warehouse stores execution traces in a
database. |
Execution stack (XU and rule sessions)
On WebSphere® Application Server, the
activity of the execution unit is logged by the Java logger. On the other supported application
servers and Java SE, the execution
unit uses the logging service of the Java connector
architecture (JCA). The traceLevel and traceAutoFlush properties
control the XU logging with JCA.
- Java logging for Java SE
You can change the log level in the XU in one the following
ways: or the
ra.xml file. You can edit this file
manually or by using the
res-setup Ant script.
- Use the rule session API: you might have to recompile the customer
code when you want to change the settings or use some configuration
options.
- Edit the ra.xml file manually: you must then
edit the class path and put it in the right place.
- Edit the ra.xml file manually by running
the res-setup Ant script.
The XU uses the following JAR file: <InstallDir>\executionserver\lib\jrules-res-execution.jar
Here
are the default settings in the
default-ra.xml deployment
descriptor file:
- jdkLoggingEnabled set to false
- traceLevel set to FINE
- traceAutoFlush set to false:
the XU does not flush the log buffer each time a message is logged.
- Java logging for Java EE
The XU uses the <InstallDir>\executionserver\applicationservers\<appserver>\jrules-res-xu-<appserver>.rar file.
- WebSphere Application Server and
JBoss 6.1
You can change the log level through the Java logging options in the administration console
of the application server.
Here are the default settings in
the
ra.xml deployment descriptor.
- jdkLoggingEnabled set to true on WebSphere Application Server
- traceLevel set to FINE -
ignored on WebSphere Application Server
- traceAutoFlush set to false
- ignored on WebSphere Application Server
- Logger name: com.ibm.rules.execution
- Other supported application servers
You can change the log level through the JCA logging service.
Use the specific tool of your application server to change the settings
of a connection factory.
Here are the default settings in the
ra.xml deployment
descriptor.
- jdkLoggingEnabled set to false
- traceLevel set to FINE
- traceAutoFlush set to false:
the XU does not flush the log buffer each time a message is logged.
To turn on the full XU log, set the values as follows:
- traceLevel to ALL
- traceAutoFlush to true
Hosted transparent decision services
By
default, hosted transparent decision services use the following .ear file: <InstallDir>\executionserver\applicationservers\<appserver>\jrules-res-htds-<appserver>.ear.
Hosted
transparent decision services use the
log4j Apache
logger, which is defined as a context parameter in the
web.xml file,
the deployment descriptor for web applications.
<display-name>DecisionService</display-name>
<context-param>
<param-name>log4j-init-filename</param-name>
<param-value>log4j.lcf</param-value>
</context-param>
Default
log4j settings
in
WEB-INF/classes/log4j.lcf:
- log4j.logger.ilog.rules.res.decisionservice=INFO, DS_LOG_FILE
- log4j.appender.DS_LOG_FILE=org.apache.log4j.RollingFileAppender
- log4j.appender.DS_LOG_FILE.File=logs/res-decisionservice.log
- log4j.appender.DS_LOG_FILE.MaxFileSize=10MB
- log4j.appender.DS_LOG_FILE.MaxBackupIndex=2
- log4j.appender.DS_LOG_FILE.Encoding=UTF-8
- log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
- log4j.appender.DS_LOG_FILE.layout.ConversionPattern=<%d>
%-5p [%c] : %m%n
You can add other appenders on these loggers, but DS_LOG_FILE must
be present.
Rule Execution Server console
By
default, the Rule Execution Server console
uses the following .ear file: <InstallDir>\executionserver\applicationservers\<appserver>\jrules-res-management-<appserver>.ear
The
Rule Execution Server console
use the
log4j Apache logger, which is defined as
a context parameter in the
web.xml file, the
deployment descriptor for web applications:
<context-param>
<description>LOG4J configuration file. Can be modified.</description>
<param-name>log4j-init-filename</param-name>
<param-value>log4j.lcf</param-value>
</context-param>
Default log4j settings in
WEB-INF/classes/log4j.lcf:
- log4j.appender.RES_LOG_FILE=org.apache.log4j.RollingFileAppender
- log4j.appender.RES_LOG_FILE.File=../logs/res-console.log
- log4j.appender.RES_LOG_FILE.MaxFileSize=10MB
- log4j.appender.RES_LOG_FILE.MaxBackupIndex=2
- log4j.appender.RES_LOG_FILE.Encoding=UTF-8
- log4j.appender.RES_LOG_FILE.layout=org.apache.log4j.PatternLayout
- log4j.appender.RES_LOG_FILE.layout.ConversionPattern=<%d>
%-5p [%c] : %m%n
- log4j.appender.RES_CONSOLE=ilog.rules.res.console.util.IlrRollingMemoryAppender
- log4j.appender.RES_CONSOLE.MaxLength=100
- log4j.logger.ilog.rules.res.model.mbean=INFO, RES_LOG_FILE,
RES_CONSOLE
- log4j.logger.ilog.rules.res.console=INFO, RES_LOG_FILE,
RES_CONSOLE