Loggable: a simple log4j meta-library – Part 2

In a recent post I described the goal of my Loggable meta-library. If you haven’t read it yet, I suggest you to do it now.

What we are going to do now is analysing the second main component of the meta-library, the centralized controller Log.

How does it work

The main responsibility of the Log class is handling the logic behind the creation and returning of the Logger instance that the caller class should use. This logic, as we’ve already seen, is driven by the @Loggable annotation.

The Log class will have a single point of access: the public static method get().

Leggi tutto →

Loggable: a simple log4j meta-library – Part 1

If you work in a J2EE environment, you surely have (or at least will have) used the standard Apache log4j library almost once. This powerful and configurable logging library is commonly used throughout whole enterprise projects, for many reasons: debugging, testing, exception logging, tracing, application profiling, et cetera.

In this article I want to explain a meta-library that I am currently writing to allow a more decentralized control of the log4j library methods and an easier log-calls implementation throught your entire application: convention over configuration. This is my motto.

Leggi tutto →