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

Gary Gregory commented on LOG4J2-2145:
--------------------------------------

Hello [~aarjav]:

Please feel free to provide a patch on GitHub: 
[https://github.com/apache/logging-log4j2/]

You should add some validation to the builders in:

- org.apache.logging.log4j.mongodb2.MongoDbProvider.Builder.build()
- org.apache.logging.log4j.mongodb3.MongoDbProvider.Builder.build()

Gary

> MongoDb appender configuration: database name is required even when not used
> ----------------------------------------------------------------------------
>
>                 Key: LOG4J2-2145
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2145
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 2.9.1, 2.10.0
>            Reporter: Aarjav Patel
>            Priority: Minor
>              Labels: easyfix
>
> As shown in an example here 
> https://logging.apache.org/log4j/2.x/manual/appenders.html#NoSQLAppender, it 
> is possible to configure MongoDb appender without specifying the databaseName 
> in the log4j config by providing factoryClass and factoryMethod.
> However due to the @Required annotation on the databaseName field makes the 
> configuration invalid and throwns an exception.
> https://github.com/apache/logging-log4j2/blob/44db87d0e921bac3b207f575889618ced5288e5f/log4j-mongodb/src/main/java/org/apache/logging/log4j/mongodb/MongoDbProvider.java#L144



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to