Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.16.0
-
None
-
None
Description
Logging an exception with
LOG.warn("test log", new RuntimeException("test ex"));
does not work and throws the following exception:
org.apache.logging.log4j.core.appender.AppenderLoggingException: Unable to write to database in appender: Can't find a codec for class org.apache.logging.log4j.mongodb4.MongoDb4DocumentObject.
There's a blog post [1] providing a workaround which is rewrite of MongoDb4Provider which causes classpath issues.
[1]https://blog.termian.dev/posts/log4j2-mongodb-appender/