Configuring Logging

By default, log files for TIBCO ComputeDB members are created inside the working directory of the member. To change the log file directory, you can specify a property -log-file as the path of the directory, while starting a member.

TIBCO ComputeDB uses log4j for logging. You can configure logging by copying the existing template file to the conf directory and renaming it to

For example, the following can be added to the file to change the logging level of the classes of Spark scheduler.

$ cat conf/

The default template uses a custom layout (io.snappydata.log4j.PatternLayout) that adds a thread ID at the end of thread name in the logs for the %t pattern.

For example, the default pattern:

log4j.appender.file.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss.SSS zzz} %t %p %c{1}: %m%n


17/11/07 16:42:05.115 IST serverConnector<tid=0xe> INFO snappystore: GemFire P2P Listener started on  tcp:///

This is the recommended PatternLayout to use for TIBCO ComputeDB logging.

When using a custom, and the mentioned layout cannot be used or when using AsyncAppender, then a custom appender ThreadIdAppender has been provided that can be inserted as the first appender to get the same output.


When using the default PatternLayout in the file:

log4j.rootCategory=INFO, file


When adding the custom appender

log4j.rootCategory=INFO, threadId, file



Setting Log Level at Runtime

The inbuilt procedure set_log_level can be used to set the log level of TIBCO ComputeDB classes at runtime. You must execute the procedure as a system user.

Following is the usage of the procedure:

call sys.set_log_level (loggerName, logLevel);

The logLevel can be a log4j level, that is, ALL, DEBUG, INFO, WARN, ERROR, FATAL, OFF, TRACE. loggerName can be a class name or a package name. If it is left empty, the root logger's level is set.

For example:

// sets the root logger's level as WARN
snappy> call sys.set_log_level ('', 'WARN' );

// sets the WholeStageCodegenExec class level as DEBUG
snappy> call sys.set_log_level ('org.apache.spark.sql.execution.WholeStageCodegenExec', 'DEBUG');

// sets the apache spark package's log level as INFO
snappy> call sys.set_log_level ('org.apache.spark', 'INFO');

Snappy Store Logging

The fine-grained log settings are applicable for classes other than the Snappy Store classes. Snappy Store does not honor fine-grained log settings. That is, you can only set the log level for the root category. However, log level of specific features of TIBCO ComputeDB store can be controlled both during the start and during runtime.

Using Trace Flags for Advanced Logging For Snappy Store

Snappy Store provides the following trace flags that you can use with the gemfirexd.debug.true system property to log additional details about specific features:

Trace flag Enables
QueryDistribution Detailed logging for distributed queries and DML statements, including information about message distribution to TIBCO ComputeDB members and scan types that were opened.
StatementMatching Logging for optimizations that are related to unprepared statements.
TraceAuthentication Additional logging for authentication.
TraceDBSynchronizer DBSynchronizer and WAN distribution logging.
TraceClientConn Client-side connection open and close stack traces.
TraceClientStatement Client-side, basic timing logging.
TraceClientStatementMillis Client-side wall clock timing.
TraceIndex Detailed index logging.
TraceJars Logging for JAR installation, replace, and remove events.
TraceTran Detailed logging for transaction events and operations, including commit and rollback.
TraceLock_* Locking and unlocking information for all internal locks.
TraceLock_DD Logging for all DataDictionary and table locks that are acquired or released.

To enable logging of specific features of TIBCO ComputeDB, set the required trace flag in the gemfirexd.debug.true system property. For example, you can add the following setting inside the configuration file of the TIBCO ComputeDB member to enable logging for query distribution and indexing:

localhost -J-Dgemfirexd.debug.true=QueryDistribution,TraceIndex

If you need to set a trace flag in a running system, use the SYS.SET_TRACE_FLAG system procedure. The procedure sets the trace flag in all members of the distributed system, including locators. You must execute the procedure as a system user. For example:

snappy> call sys.set_trace_flag('traceindex', 'true');
Statement executed.


Trace flags work only for snappy and jdbc and not for snappy-sql.