IBM Support

How to write TM1 Server debug logging to an alternate log file

Technote (troubleshooting)


Problem(Abstract)

It's possible to enable TM1 Server debug in a log file other than the tm1server.log. The debug logging options can be configured by creating or updating the tm1s-log.properties file. The tm1s-log.properties file must exist in the same directory as the tm1s.cfg file. If no tm1s-log.properties file is present the default logging options are used. After creating or updating the tm1s-log.properties file no restart of the TM1 Server is required for the debug logging to start.

The debug options in the tm1s-log.properties file should be carefully considered before being enabled. Some of debug options will degrade TM1 Server performance and some debug options can be extreamly verbose, causing very large log file.

Resolving the problem

Create or update the tm1s-log.properties file to contain the following content.


log4j.logger.TM1=INFO, S1
log4j.appender.S1=org.apache.log4j.SharedMemoryAppender
log4j.appender.S1.MemorySize=5 MB
log4j.appender.S1.MaxFileSize=100 MB
log4j.appender.S1.MaxBackupIndex=20
log4j.appender.S1.TimeZone=LOCAL

log4j.logger.TM1.Login=DEBUG, LOCK
log4j.additivity.TM1.Login=false

log4j.logger.TM1.Lock.Exception=DEBUG, LOCK
log4j.additivity.TM1.Lock.Exception=false

log4j.appender.LOCK=org.apache.log4j.SharedMemoryAppender
log4j.appender.LOCK.File=lock.log
log4j.appender.LOCK.MaxFileSize=100 MB
log4j.appender.LOCK.MaxBackupIndex=20
log4j.appender.LOCK.TimeZone=Local

The login and lock exception debug logging will be written to a file named lock.log. This log file will be created in the same directory as the tm1server.log file. The login and lock exception debug options from the above example are not know to cause TM1 Server performance issues and are not very verbose.

It's possible to split the debug logging options into separate log files by configuring the tm1s-log.properties file as follows.

log4j.logger.TM1.Login=DEBUG, LOCK
log4j.additivity.TM1.Login=false

log4j.logger.TM1.Lock.Exception=DEBUG, LOCK
log4j.additivity.TM1.Lock.Exception=false

log4j.appender.LOCK=org.apache.log4j.SharedMemoryAppender
log4j.appender.LOCK.File=lock.log
log4j.appender.LOCK.MaxFileSize=100 MB
log4j.appender.LOCK.MaxBackupIndex=20
log4j.appender.LOCK.TimeZone=Local

log4j.logger.TM1.HttpRequest=DEBUG, REST
log4j.additivity.TM1.HttpRequest=false

log4j.logger.TM1.HttpRequestHeaders=DEBUG, REST
log4j.additivity.TM1.HttpRequestHeaders=false

log4j.logger.TM1.HttpRequestBody=DEBUG, REST
log4j.additivity.TM1.HttpRequestBody=false

log4j.logger.TM1.HttpResponse=DEBUG, REST
log4j.additivity.TM1.HttpResponse=false

log4j.logger.TM1.HttpResponseHeaders=DEBUG, REST
log4j.additivity.TM1.HttpResponseHeaders=false

log4j.logger.TM1.HttpResponseBody=DEBUG, REST
log4j.additivity.TM1.HttpResponseBody=false

log4j.appender.REST=org.apache.log4j.SharedMemoryAppender
log4j.appender.REST.File=restapi.log
log4j.appender.REST.MaxFileSize=100 MB
log4j.appender.REST.MaxBackupIndex=20
log4j.appender.REST.TimeZone=Local

In this example separate lock.log and restapi.log files will be created. Login and lock debug logging will be written to only the lock.log file, and the REST API debug logging to only the restapi.log file.

Document information

More support for: Cognos TM1
TM1 Server

Software version: 10.2, 10.2.2

Operating system(s): AIX, Linux, Windows

Reference #: 2003062

Modified date: 12 October 2017