Add the following dependency to your pom.xml:
<dependency> <groupId>com.onloupe</groupId> <artifactId>loupe-log4j-support</artifactId> <version><-- desired version --></version> </dependency>
Then, modify your Log4J configuration to add the appender to the appenders inventory and register it to a scope of your choosing (root to capture everything). A minimal example is:
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration> <-- Add this line to add the Loupe appender to Log4j --> <appender name="LoupeLog4jAppender" class="com.onloupe.appenders.log4j.LoupeLog4jAppender"/> <-- This registers Loupe to get DEBUG or higher messages for everything> <root> <level value="DEBUG" /> <appender-ref ref="LoupeLog4jAppender" /> </root> </log4j:configuration>