[ 
https://issues.apache.org/jira/browse/LOG4J2-474?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nick Williams reassigned LOG4J2-474:
------------------------------------

    Assignee: Nick Williams

> MongoDBProvider won't work with databases that don't have authentication set 
> up
> -------------------------------------------------------------------------------
>
>                 Key: LOG4J2-474
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-474
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 2.0-beta9
>            Reporter: Tal Liron
>            Assignee: Nick Williams
>         Attachments: MongoDbLog4jProvider.java
>
>
> The problem is in line 178:
> {code}
> if (!database.isAuthenticated()) {
> {code}
> This assumes that isAuthenticated() returns true when authentication isn't 
> need. However, that is incorrect: databases without authentication configured 
> will return false here, in which case the provider will not be able to work 
> them.
> I suggest simply removing this "if" (and also the "else" code from 183-187) 
> -- if authentication is required, errors will happen soon enough. 
> Unfortunately the MongoDB API doesn't let you know this until you try.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to