Skip to content
Skip to breadcrumbs
Skip to header menu
Skip to action menu
Skip to quick search
Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Sign Up
Dashboard
Bitronix Transaction Manager
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
Other Macros
Page Layout
No Layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<h1>Debug logging</h1> <p>BTM ships with <a href="http://www.slf4j.org/">SLF4J</a> 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.</p> <p>Much like Commons Logging, SLF4J can route the log requests to many different implementations including the two most common ones: <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/logging/package-summary.html">JDK 1.4</a> and <a href="http://logging.apache.org/log4j/">Log4J</a>.</p> <p>By default, BTM is shipped with slf4j-jdk14-1.5.8.jar which is the the <a href="http://jcp.org/aboutJava/communityprocess/review/jsr047/">JSR 047 logging API (aka JDK 1.4 logging)</a> wrapper. If you want to use another logger, simply delete the slf4j-jdk14-1.5.8.jar file and replace it with any one from this list:</p> <ul> <li><a href="http://repo2.maven.org/maven2/org/slf4j/slf4j-jdk14/1.5.8/slf4j-jdk14-1.5.8.jar">slf4j-jdk14-1.5.8.jar</a> for JSR 047 logging.</li> <li><a href="http://repo2.maven.org/maven2/org/slf4j/slf4j-jdk14/1.5.8/slf4j-log4j12-1.5.8.jar">slf4j-log4j12-1.5.8.jar</a> for Apache Log4J 1.2.x.</li> <li><a href="http://repo2.maven.org/maven2/org/slf4j/slf4j-jdk14/1.5.8/slf4j-nop-1.5.8.jar">slf4j-nop-1.5.8.jar</a> for no logging (logs are silently dropped).</li> <li><a href="http://repo2.maven.org/maven2/org/slf4j/slf4j-jdk14/1.5.8/slf4j-simple-1.5.8.jar">slf4j-simple-1.5.8.jar</a> for simple <code>System.out</code> output.</li> </ul> <p>You will also need to put the <a href="http://repo2.maven.org/maven2/org/slf4j/slf4j-api/1.5.8/slf4j-api-1.5.8.jar">slf4j-api-1.5.8.jar</a> file in your classpath as well, no matter which one of the above jars you choose.</p> <p>Those jars come from the 1.5.8 distribution of SLF4J.</p> <h2>Mapped Diagnostic Context</h2> <p><em>This feature appeared in BTM 1.3.3 and is not available in earlier versions.</em></p> <p>If your logging implementation supports MDC (like <a href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/MDC.html">Log4J does</a> for instance) BTM will push the transaction's GTRID in the logger's MDC when a transaction is created.</p> <p>The GTRID is pushed under the <strong><code>btm-gtrid</code></strong> name. You can make it appear in your Log4J logs by adding it to the <code>ConversionPattern</code>:</p> <table class="wysiwyg-macro" data-macro-name="code" data-macro-default-parameter="xml" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6eG1sfQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> <appender name="FileAppender" class="org.apache.log4j.FileAppender"> <param name="File" value="SomeLogFile.txt"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%X{btm-gtrid} - %m%n"/> </layout> </appender> </pre></td></tr></table> <p>When using a different implementation than Log4J, please refer to your logger's documentation to understand how to make use of this feature.</p> <p><img class="confluence-embedded-image confluence-external-resource" src="http://www.bitronix.be/images/shim.gif" data-image-src="http://www.bitronix.be/images/shim.gif"></p>
Please type the word appearing in the picture.
Attachments
Labels
Location
Watch this page
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced