Application Logging
You can generate separate log files for an application either by configuring the
Log activity in
TIBCO Business Studio for BusinessWorks or by modifying the
logback.xml file of the AppNode.
To support application logging, the following prerequisites must be satisfied.
-
A sifting appender
<appender-ref ref="APPLICATION-FILE"/>must be present in thelogback.xmlfile of the AppNode. - To support
Debugging a Specific Application on the AppNode, the logger BWApp must be present in the
logback.xmlfile of the AppNode.<!-- Do not modify this logger--> <logger name="BWApp"> <level value="ERROR"/> </logger> - To avoid having hash (#) as part of the logger names in the log files, the appenders present in the
logback.xmlfile must use the following encoder:- For AppNode:
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder"> <layout class="com.tibco.bw.extensions.logback.BWLoggerPatternLayout"/> </encoder> - For
TIBCO Business Studio for BusinessWorks:
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder"> <layout class="com.tibco.bw.extensions.logback.BWLoggerPatternLayoutStudio"/> </encoder>
- For AppNode:
By default, new log files are created under the {BW.HOME}/bw/6.x/logs directory for
TIBCO Business Studio for BusinessWorks, and for the AppNode, new log files are created under the {APPNODE.HOME}/log directory.
${fileName} to define the name of the file.
Controlling the Output of the Log Activity
You can configure Log activity messages to be logged into separate files in one of the following ways:
- By configuring the Log Activity in
TIBCO Business Studio for BusinessWorks
You can configure the Log activity in TIBCO Business Studio for BusinessWorks to separate logs by application, process, or event type, depending on the options selected in the Log activity.
For more information about options in the Log activity, see the "Log" section in the TIBCO ActiveMatrix BusinessWorks™ Binding and Palettes Reference.
- By configuring the Logger in the AppNode's
logback.xmlfileYou can separate the logs from the Log activity based on your application, without changing the Log activity just by modifying the
logback.xmlfile of the AppNode.- For one application, add a logger in the
logback.xmlfile of the AppNode as follows:<logger name="BWApp.#APPNAME#.com.tibco.bw.palette.generalactivities.Log" additivity="false"> <level value="DEBUG"/> <appender-ref ref="APPLICATION-FILE"/> </logger>APPNAME is the name of the application.
- For multiple or all applications, add the previous logger for each application or follow the steps specified in the Creating Separate Log Files for Each Application on the AppNode section.
- For one application, add a logger in the
Displaying Log Activity Messages on TIBCO Business Studio for BusinessWorks Console
To display the Log activity messages in the TIBCO Business Studio for BusinessWorks console, the additivity attribute can be omitted from the logger if the root logger is using STDOUT as its appender.
logback.xml file, the logs can only be separated by application and not by process or eventType.