Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-3392

AppenderLoggingException logging any exception to a MongoDB Appender

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.16.0
    • 2.17.2
    • 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/

      Attachments

        Activity

          People

            ggregory Gary D. Gregory
            ugurlu Omer U
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: