views:

145

answers:

2

When Atomikos is configured via Spring, a jta.properties or transactions.properties file is not needed. Nonetheless, Atomikos starts up with the follow messages printed to stderr:

No properties path set - looking for transactions.properties in classpath...
transactions.properties not found - looking for jta.properties in classpath...
Failed to open transactions properties file - using default values

It makes it look like the Spring configuration didn't take -- although apparently everything is fine. Does anyone know how to get rid of this so I don't end up getting asked about it 1.000 times?

Is there a way to redirect stderr from a particular component or jar?

+1  A: 

Atomikos logs with SLF4J. If only this dependency logs with SLF4J, you can use SLF4J's NOP binder and nothing will be logged. Probably not what you want, but very simple.

You can configure your SLF4J's backend logger to ignore log messages in specific packages. An example with logback as SLF4J' backend logger:

<logger name="com.atomikos.something" level="OFF"/>

I have written a tutorial about SLF4J and different backend loggers here.

Espen
Unfortuneatly, Atomikos isn't logging to the console, their printing to stderr. In my opinion, this is a bug, but in the meantime, I need to get rid of this! Thanks.
HDave
Are you using SLF4J's SIMPLE implementation? From the [Javadoc](http://slf4j.org/api/org/slf4j/impl/SimpleLogger.html "SimpleLogger"): A simple (and direct) implementation that logs messages of level INFO or higher on the console (System.err).
Espen
A: 

You need to create your own transaction service bean and the messages will magically disappear. Follow the instructions here:

http://stackoverflow.com/questions/3256415/how-to-move-location-of-atomikoss-tm-out-and-epoch-files/3265957#3265957

HDave