NOTE: Logda's API is not final yet. Although the library is fairly funcional, this is still beta-quality code. Do not rely on it for production code just yet. Feedback is very welcome!
Logda is currently a Log4j logging bridge with support for Java 8 Lamdas.
- Log4j equivalent api (Means same method signatures)
- Less code overhead for adaptive logging
Assuming you are using Log4j today
-
Checkout this projekt and run
mvn install
in the root of this projekt -
Add the following dependency to your Maven projekt
<dependency> <groupId>dk.mwl.logda</groupId> <artifactId>logda-log4j</artifactId> <version>1.0-SNAPSHOT</version> </dependency>
-
Start replacing your org.apache.log4j.Logger and org.apache.log4j.LoggerFactory imports with dk.mwl.logda.Logger and dk.mwl.logda.LoggerFactory
-
Start logging with
logger.debug(() -> "Queue size=" + queue.size())
As this example is using Java 8's Lambda expressions it will only calculate the queue size if debug logging is enable for this context.