Qi4j

Logging & Tracing

code
docs
tests
The Logging & Tracing library in Qi4j is taking full advantage of the Qi4j runtime model.

Most of us are used to Log4J, Commons-Logging or something similar, where your code have to call a singleton, which returns some form of "Logger" instance which you call. Also, that Logger instance typically have a lot of methods for both tracing, debugging and logging.

We think that this model is flawed, and are taking this opportunity to change your view of a Logging & Tracing system.

Logging


In Qi4j, Logging means "Domain-centric Events to be Recorded", and is not related to the general practice of using logging frameworks to track down bugs.

See Logging for details.

Debugging


We have noticed that most common use of logging is actually to aid in the development work, and not for recording importand domain-centric events. Therefor, we have increased the granularity available for "debug" statements, and moved it into its own service, not to mistake it with the Logging of domain events.

The Debugging system allows for (near) unlimited number of "levels", and yet provide simple to use interfaces with a single method per level.

See Debugging for details.

Tracing


People often want to see how the program have flown through the code, often only intersted in certain locations, and at those locations we insert a trace statement like;
logger.trace( "I was here. 15" );
Often this is arbitrary strings, and we intend to clean them up later, sometime we forget...

But, what we really are after is to get a marker along an execution line that the code has entered/exited a method. By using the Qi4j features of Service, AppliesTo, Concerns and SideEffects, we think we are giving a much more convenient way to do exactly that.

See Tracing for the details.


Qi4j and the Qi4j logo are trademarks of Richard Öberg, Niclas Hedhman and the members of the Qi4j Core Team. See Qi4j licensing for more information.
Powered by SiteVisionexternal link.