Configuring the Logs

22 Jul 2015 - 07:24 | Version 4 | | , , ,

Basic Rules

As of release 3.8, Atomikos uses any existing logging frameworks found by these rules :

  • any implementation of SLF4J that can be found in the classpath (e.g., Logback), or
  • if not found and Log4J is available in the classpath, then Log4J will be used, or
  • otherwise, the built-in JDK logging is used

Configuration Examples

Logback

<configuration>

  <!-- Optional: to enable JMX setting of log levels 
       cf http://logback.qos.ch/manual/jmxConfig.html -->
  <jmxConfigurator/> 

  <appender name="ATOMIKOS" class="ch.qos.logback.core.FileAppender">
    <file>tm.out</file>
    <append>true</append>

    <encoder>
      <pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</pattern>
    </encoder>
  </appender>

 <logger name="com.atomikos" level="WARN">
    <appender-ref ref="ATOMIKOS" />
  </logger>

</configuration>

Log4J

log4j.appender.Atomikos = org.apache.log4j.RollingFileAppender
log4j.appender.Atomikos.File = tm.out
log4j.appender.Atomikos.MaxFileSize = 100KB
log4j.appender.Atomikos.Append = false
log4j.appender.Atomikos.layout = org.apache.log4j.PatternLayout
log4j.appender.Atomikos.layout.ConversionPattern=%p %t %c - %m%n
log4j.logger.com.atomikos=WARN, Atomikos

JDK logging

Note: This solution seems to disallow a separate file for separate loggers. In order to reproduce a separate tm.out you would need a Tomcat/apache utility library - see http://tomcat.apache.org/tomcat-5.5-doc/logging.html
# Set the default logging level for the logger named com.mycompany
com.atomikos.level = WARNING
com.atomikos.handlers = java.util.logging.FileHandler

java.util.logging.FileHandler.pattern=tm.out

java.util.logging.FileHandler.limit=50000

com.atomikos.useParentHandlers=false

java.util.logging.FileHandler.count=1
java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter

Contact Us

Atomikos Corporate Headquarters
Hoveniersstraat, 39/1, 2800
Mechelen, Belgium

E info@atomikos.com
E sales@atomikos.com
T +3215613055

Subscribe to our newsletter

Never miss an update

Copyright 2016 Atomikos BVBA