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 "Matt Sicker (JIRA)" <ji...@apache.org> on 2014/04/01 17:19:15 UTC

[jira] [Comment Edited] (LOG4J2-591) Log4j closes MongoDB connections after the first log message

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

Matt Sicker edited comment on LOG4J2-591 at 4/1/14 3:18 PM:
------------------------------------------------------------

So does MongoClient hold an internal pool of connections, or is each MongoClient a connection object? If it's the latter, then it looks like we'll have to borrow some code from dbcp2 or commons-pool. This is related to the JDBC one as well (which we might be removing the non-JNDI versions of).

Edit: oh ok, thanks.


was (Author: jvz):
So does MongoClient hold an internal pool of connections, or is each MongoClient a connection object? If it's the latter, then it looks like we'll have to borrow some code from dbcp2 or commons-pool. This is related to the JDBC one as well (which we might be removing the non-JNDI versions of).

> Log4j closes MongoDB connections after the first log message
> ------------------------------------------------------------
>
>                 Key: LOG4J2-591
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-591
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 2.0-rc1
>            Reporter: Tal Liron
>            Priority: Critical
>
> It seems that the AbstractDatabaseManager behavior is now to close the connection after the buffer is flushed (or immediately after a write if there is no buffer). These are the calls to commitAndClose().
> The intended behavior for close() is that it would return a connection to the connection pool. That would make sense for most good database drivers.
> However, the MongoDBProvider simply closes the MongoClient, releasing the entire pool. This means that further attempts to write to the log, after the first time, will fail.



--
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