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.

Prerequisites

  • A sifting appender <appender-ref ref="APPLICATION-FILE"/> must be present in the logback.xml file of the AppNode.

  • To support Debugging a Specific Application on the AppNode, the logger BWApp must be present in the the logback.xml file 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.xml file 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>
      

By default, new log files are created under {BW.HOME}/bw/6.x/logs directory for TIBCO Business Studio for BusinessWorks, and for the AppNode, new log files are created under {APPNODE.HOME}/log directory.

Note: You can specify a custom location for creation of the log file. However you must use the variable ${fileName} to define the name of the file.

Controlling 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 upon 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.xml file

    You can separate logs from the Log activity based on your application, without changing the Log activity just by modifying logback.xml file of the AppNode.

    • For one application, add a new logger in the logback.xml file 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 aplications, 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.

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.

Note: By modifying the logback.xml file, the logs can only be separated by application and not by process or eventType.