Registry / logging / log4j-jpa

log4j-jpa

JSON →
library2.26.0javamavenunverified

Provides a JPA appender for Log4j 2, enabling logging to relational databases via the Java Persistence API.

<dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-jpa</artifactId> <version>2.26.0</version> </dependency>
INSTALL
IMPORT
SIG · LOG4J-JPA
L
log4j-jpa
loggingjavav2.26.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

JpaAppender
org.apache.logging.log4j.jpa.appender.JpaAppender

Builds a JPA appender for Log4j 2.

import org.apache.logging.log4j.jpa.appender.JpaAppender; import org.apache.logging.log4j.core.config.Property; public class Example { public static void main(String[] args) { JpaAppender appender = JpaAppender.newBuilder() .setName("JPA") .setPersistenceUnitName("log4j") .build(); System.out.println("JPA appender built."); } }
Debug
Known issues
gotchaRequires a configured JPA persistence unit; ensure your persistence.xml is set up correctly.
fix
Add a persistence.xml with the required entity classes and database connection details.
affects: >=2.0.0
Upgrade
Version history
2.26.0latest on Maven
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
Resources
log4j-jpa — mvn dependency:get log4j-jpa · libregistry