You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Tal Liron (JIRA)" <ji...@apache.org> on 2014/04/01 04:51:15 UTC

[jira] [Updated] (LOG4J2-474) MongoDBProvider won't work with databases that don't have authentication set up

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

Tal Liron updated LOG4J2-474:
-----------------------------

    Affects Version/s:     (was: 2.0-beta9)
                       2.0-rc1

> 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-rc1
>            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.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org