How to turn on DEBUG logging to troubleshoot an issue

How to turn on DEBUG logging to troubleshoot an issue

book

Article ID: KB0074085

calendar_today

Updated On:

Products Versions
TIBCO Streaming 7

Description

StreamBase Support has requested a DEBUG log from executing an application. How do I create one?

Issue/Introduction

How to turn on DEBUG logging to troubleshoot an issue

Resolution

Applications may be run from SBStudio or the command-line. The way to turn on and capture DEBUG console output is different depending on how the application is launched.

A. To get a DEBUG console log from SB Studio...

1) Create a Run Configuration for the application

1.1 Open the top level .sbapp in the editor
1.2 Use menu: Run > Run Configurations...
1.3 Double-click: StreamBase Application in the left pane of the dialog
1.4 Click Browse and select the open .sbapp

2) Set on the Advanced tab the logging level to: Specified, level 2

3) Set on the Common tab, Standard Input and Output, to File

3.1 Click Workspace and select the .sbapp's Project folder, click OK
3.2 Append to the ${workspace_loc:/<project>}, /run.log

4) Save and run the configuration by clicking Apply and then Run (you may need to force it to run with Typecheck errors).

More information is available here:
  Help > Test/Debug Guide > Running Applications > Editing Launch Configurations

B. To get a DEBUG console log from the command-line...

a. If using custom logging...

The server's sbd.sbconf file will have either:
  • <sysproperty name="logback.configurationFile" value="/path/to/logback.xml"/>
    or:
  • <sysproperty name="log4j.configuration" value="log4j.xml"/>

Modify the referenced file and restart the sbd server to report debug logging. In all cases, change "INFO" to "DEBUG" where specified in the file. The logging configuration file will show where the log file is being created.

b. If not using custom logging...

For TIBCO StreamBase 7:
On Unix/Linux using a bash-shell terminal window using the default logging configuration:
  $ export STREAMBASE_LOG_LEVEL=2
 $ sbd -f sbd.sbconf app.sbapp
>run.log 2>&1
On Windows (from StreamBase Command Prompt) execute:
  C:\> set STREAMBASE_LOG_LEVEL=2
  C:\> sbd -f sbd.sbconf app.sbapp >run.log 2>&1
Send the run.log file back to Support as a case attachment.

For TIBCO Streaming 10.x and later, global DEBUG logging is not recommended. Instead enable debug logging for specific adapters within the project and re-build and re-deploy using epadmin. Alternatively, modify the logback.xml configuration to turn on DEBUG logging for specific features. By default the DEBUG output is written into the node directory logs/default-engine-for-*.log files and will be included in any node snapshot created after startup.
 

C. To get a DEBUG console log from a StreamBase Unit-Test (JUnit)

Add to the test.java setupServer() method:

System.setProperty("streambase.log-level", "2");

For example:
public static void setupServer() throws Exception {
  // create a StreamBase server and load applications once for all tests in this class
  System.setProperty("streambase.log-level", "2");
  server = ServerManagerFactory.getEmbeddedServer();
  server.startServer();
  server.loadApp("test.sbapp");
}
The output will go to the Console, and may be copied from there.