Creating Separate Log Files for Each Application on the AppNode

There are two steps to generate separate log files for each application running on an AppNode:

  1. Change the value of the property bw.engine.separate.logs.by.app to true from the default value false in the config.ini file of the AppSpace or the AppNode.
    To enable this property through TIBCO Business Studio™ for BusinessWorks™, pass it as a VM argument using the -D option.
    Note: If the bw.engine.separate.logs.by.app property is set at the AppNode level, this setting takes precedence over the property set at the AppSpace level. Restart the AppNode when the property is updated.
  2. Add or modify the loggers in the logback.xml file of AppNode to use <appender-ref ref="APPLICATION-FILE" />.
Note: If there are any logs that are not specific to an application, and logs generated from all loggers other than supported loggers, are written to the defaulf bwappnode.log file.

To create separate log files for all applications in the AppNode, without modifying the Log activity and without adding multiple loggers to the logback.xml file, set the property bw.engine.separate.logs.by.app to true and if not already present add the <appender-ref ref="APPLICATION-FILE" /> to the logger com.tibco.bw.generalactivities.palette as follows:

<logger name="com.tibco.bw.palette.generalactivities.Log"  additivity="false">
    <level value="DEBUG"/>
     <appender-ref ref="APPLICATION-FILE"/>
 </logger>

The following examples demonstrate some common use cases:

  1. To separate supported logs by application name, modify the root logger's appender to use the new sifting appender.
     <root level="ERROR">
        <appender-ref ref="APPLICATION-FILE" />
    </root>

    This configuration causes all ERROR logs from all the supported loggers to be separated by application name. The level of individual loggers can be set to a desired value such as DEBUG, ERROR, or INFO.

  2. To separate logs of only com.tibco.bw.core by application name, modify the logger as follows:
    <logger name="com.tibco.bw.core" additivity="false">
    <level value="ERROR"/>
    <appender-ref ref="APPLICATION-FILE"/>
    </logger>
  3. To separate all palette logs by application name, modify the com.tibco.bw.palette logger as follows:
    <logger name="com.tibco.bw.palette" additivity="false">
    <level value="DEBUG"/>
    <appender-ref ref="APPLICATION-FILE"/>
    </logger>

    This configuration causes all DEBUG logs from all the palettes in the AppNode to be separated by application name.

    A similar configuration can be extended to com.tibco.bw.sharedresource and com.tibco.bx.

    <logger name="com.tibco.bw.sharedresource" additivity="false">
    <level value="DEBUG"/>
    <appender-ref ref="APPLICATION-FILE"/>
    </logger>
    <!-- ---For bx--->
    <logger name="com.tibco.bx" additivity="false">
    <level value="DEBUG"/>
    <appender-ref ref="APPLICATION-FILE"/>
    </logger>
  4. To separate logs of only JMS Connection shared resource by application name, a new logger must be added to the logback.xml file.
    <logger name="com.tibco.bw.sharedresource.jms" additivity="false">
    <level value="DEBUG"/>
    <appender-ref ref="APPLICATION-FILE"/>
    </logger>

    This configuration causes all DEBUG logs from all JMS Connection shared resources in the AppNode to be separated by application name. All other shared resources follow the behavior of the logger com.tibco.bw.sharedresource.

For TIBCO Business Studio for BusinessWorks, the bwappnode.log file is created in the same location where the application logs are generated.

If the additivity attribute is not set to false, the logger continues to use the appenders of the parent logger all the way up to the root logger until it finds a logger whose additivity is set to false.

Caution: If not configured correctly, this can lead to duplicate logging.