How to write to separate console log files for each node in a cluster

How to write to separate console log files for each node in a cluster

book

Article ID: KB0077349

calendar_today

Updated On:

Products Versions
TIBCO Streaming 10

Description

By default, the console log is written to the node 'logs/' folder. When using a Logback configuration that specifies an external file system location, console output from each instance is intermixed in that single file.

How to generate separate console log files for each of the instances? Can I pass some variable to each instance to differentiate file names?

Issue/Introduction

Use and environment variable at install time to change the logback logging configuration.

Resolution

TIBCO StreamBase and Streaming version 10 and following use Logback logging configuration.

To distinguish the logback output from two nodes running the same application on the same system, use a variable reference in the logback.xml file as so:
  <file>C:/tmp/${LOGFILE}.log</file>

When installing the first node use:
1. export LOGFILE=logfile-for-A
2. epadmin install node nodename=A.cluster application=app.zip

And when installing the second node use:
1. export LOGFILE=logfile-for-B
2. epadmin install node nodename=B.cluster application=app.zip

Step '1.' changes the value of the LOGBACK environment variable for each node.

A node preserves its environment from the 'epadmin install' command, so additional changes to the environment will not affect starting a node again after stopping it unless explicit use of the 'epadmin install node --javaenvironment="VAR=value"' command is used. This is described in the runtime documentation for the 'epadmin' command here:
  TIBCO StreamBase® Runtime Administration Guide > Chapter 8. Reference > Command line interface
  http://devzone.tibco.com/sites/streambase/latest/sb/sb-product/documentation/adminguide/ch08s02.html

Additional Information

TIBCO StreamBase® Runtime Administration Guide > Chapter 8. Reference > Command line interface