You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Omer U (Jira)" <ji...@apache.org> on 2022/02/07 11:53:00 UTC

[jira] [Commented] (LOG4J2-3392) AppenderLoggingException logging any exception to a MongoDB Appender

    [ https://issues.apache.org/jira/browse/LOG4J2-3392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17488053#comment-17488053 ] 

Omer U commented on LOG4J2-3392:
--------------------------------

Thank you [~ggregory]. It works perfect. Tested both mongo3 and mongo4.

> AppenderLoggingException logging any exception to a MongoDB Appender
> --------------------------------------------------------------------
>
>                 Key: LOG4J2-3392
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3392
>             Project: Log4j 2
>          Issue Type: Bug
>    Affects Versions: 2.16.0
>            Reporter: Omer U
>            Assignee: Gary D. Gregory
>            Priority: Major
>             Fix For: 2.17.2
>
>
> 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/



--
This message was sent by Atlassian Jira
(v8.20.1#820001)