Registry / logging / log4j-mongodb4

log4j-mongodb4

JSON →
library2.26.0javamavenunverified

A Log4j 2 appender that writes log events to MongoDB using the MongoDB 4 driver API.

<dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-mongodb4</artifactId> <version>2.26.0</version> </dependency>
INSTALL
IMPORT
SIG · LOG4J-MONGODB4
L
log4j-mongodb4
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.

MongoDbAppender
org.apache.logging.log4j.core.appender.mongodb.MongoDbAppender

Configures Log4j to use MongoDB appender (via log4j2.xml) and logs a message.

import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; public class Example { private static final Logger logger = LogManager.getLogger(Example.class); public static void main(String[] args) { logger.info("Hello, MongoDB!"); } }
Debug
Known issues
breakingRequires MongoDB 4 driver; incompatible with older MongoDB versions.
fix
Use log4j-mongodb3 for MongoDB 3 driver compatibility.
affects: >=2.0.0
Upgrade
Version history
2.26.0latest on Maven
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
14
Resources
log4j-mongodb4 — mvn dependency:get log4j-mongodb4 · libregistry