Thorbjoern Ravn Andersen wrote:
Ceki Gulcu skrev:


Here is a idea:

Marker TX_BEGIN = MarkerFactory.getMarker("TX_BEGIN");
Marker TX_END= MarkerFactory.getMarker("TX_END");

try {
  logger.info(TX_BEGIN, "beginning tx");
  doSomething();
} finally {
  logger.info(TX_END, "ending tx");
}
Ok. If I understand this correctly, it still needs additional logback configuration to map the above to snippets calling the appropriate methods hooking into the native logging system?

Indeed. The sample code above above illustrates the use of markers to
mark the beginning and the end of a transaction via the SLF4J API. You
would then need to do something with that information using the
logback API. It could be using a TurboFilter, a regular filter, an
appender or something entirely different.

What is it that you would like to achieve?


--
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch
_______________________________________________
dev mailing list
dev@slf4j.org
http://www.slf4j.org/mailman/listinfo/dev

Reply via email to