Enable terracotta client logging in integration server

HOW TO ENABLE TERRACOTTA CLIENT LOGGING IN INTEGRATION SERVER

As many of us already know, terracotta server logging will be done at the server side which will be specified in the tc-config.xml of server.

In case if we need to monitor a client that is interacting with the terracotta server, what are the ways to find out the client logging, it will be a big question.

In case of any issues while client interacting with the Terracotta server, it will be hard to decide the issue just based on either the Terracotta server log or the log which client is providing.

In order to overcome this situation, we can enable the Terracotta client logging at the client side, this will print lot of information at client side about the client and server interaction.

Let’s see how we can enable the TC logging at the client side i.e Integration server in our case:

To enable the client logging open the IS/instances/default/log4j.properties file and add the following entries:

The below configuration will print out a lot of info to the IS/instances/default/logs/tcstore.log. After you got the specific data that you needed, you can reduce the logging level to INFO. So that the logs will not consume more hard disk and reduce your machine performance.

/** log4j Rolling file Appender configuration **/

log4j.appender.tcstorefile=org.apache.log4j.RollingFileAppender

log4j.appender.tcstorefile.File=logs/tcstore.log

log4j.appender.tcstorefile.MaxFileSize=10MB

log4j.appender.tcstorefile.MaxBackupIndex=25

log4j.appender.tcstorefile.layout=org.apache.log4j.PatternLayout

log4j.appender.tcstorefile.layout.ConversionPattern=%d{dd.MM.yy HH:mm:ss.SSS} [%1p] | %m %n

/** log4j Terracotta specific configuration **/

log4j.logger.com.tc=DEBUG, tcstorefile

log4j.logger.com.terracotta= DEBUG, tcstorefile

log4j.logger.com.terracottatech= DEBUG, tcstorefile

log4j.logger.com.terracottatech.store= DEBUG, tcstorefile

log4j.logger.com.terracottatech.ehcache= DEBUG, tcstorefile

log4j.logger.org.ehcache= DEBUG, tcstorefile

log4j.logger.org.terracotta= DEBUG, tcstorefile

/** log4j configuration  to avoid the redundancy **/

log4j.additivity.com.tc=false

log4j.additivity.com.terracotta=false

log4j.additivity.com.terracottatech=false

log4j.additivity.com.terracottatech.store=false

log4j.additivity.com.terracottatech.ehcache=false

log4j.additivity.org.ehcache=false

log4j.additivity.org.terracotta=false

NOTE: In order to avoid redundancy just set the additivity property of a Log4j logger to false and then the log messages which are coming to that logger will not be propagated to its parent loggers.