Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Debug logging

BTM ships with SLF4J which is a logging facade much like Apache Commons Logging but it's safe to use in application servers unlike Commons Logging which suffers from complex classloader issues.

Much like Commons Logging, SLF4J can route the log requests to many different implementations including the two most common ones: JDK 1.4 and Log4J.

By default, BTM is shipped with slf4j-jdk14-1.6.0.jar which is the the JSR 047 logging API (aka JDK 1.4 logging) wrapper. If you want to use another logger, simply delete the slf4j-jdk14-1.6.0.jar file and replace it with any one from this list:

You will also need to put the slf4j-api-1.6.0.jar file in your classpath as well, no matter which one of the above jars you choose.

Those jars come from the 1.6.0 distribution of SLF4J.

Mapped Diagnostic Context

If your logging implementation supports MDC (like Log4J does for instance) BTM will push the transaction's GTRID in the logger's MDC when a transaction is created.

The GTRID is pushed under the btm-gtrid name. You can make it appear in your Log4J logs by adding it to the ConversionPattern:

When using a different implementation than Log4J, please refer to your logger's documentation to understand how to make use of this feature.

  • No labels