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

Marc Segond commented on LOG4J2-3140:
-------------------------------------

Sure. Here it is:
{code:java}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="DEBUG">
 <Appenders>
 <Console name="ConsoleAppender" target="SYSTEM_OUT">
 <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
 </Console>
 <File name="FileAppender" fileName="application-${date:yyyyMMdd}.log" 
immediateFlush="false" append="true">
 <PatternLayout pattern="%d{yyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} - 
%msg%n"/>
 </File>
 <NoSql name="Mongo4">
 <MongoDb4
 capped="true" collectionSize="104857600"
 
connection="mongodb+srv://username:[email protected]/MyDB.Logs?retryWrites=true&amp;w=majority"
 />
 </NoSql>
 </Appenders>
 <Loggers>
 <Root level="debug">
 <AppenderRef ref="ConsoleAppender"/>
 <!--<AppenderRef ref="FileAppender"/>-->
 <AppenderRef ref="Mongo4"/>
 </Root>
 </Loggers>
</Configuration>{code}

> Mongo4 appender stays in TimeOut
> --------------------------------
>
>                 Key: LOG4J2-3140
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3140
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 2.14.1
>         Environment: OpenJDK 11 and 13, Windows 10, IntelliJ, MongoDB 4.4.8, 
> mongo-driver-sync 4.3.1.
>            Reporter: Marc Segond
>            Priority: Major
>              Labels: MongoDB, log4j2, mongodb4
>
> I have configured a Mongo4 Appender for logging into my MongoDB Atlas Cluster.
> I have the mongo-driver-sync 4.3.1 in my pom.xml, and I use a connection 
> string of type:
> |mongodb+srv://<username>:<password>@myproject.ne6as.mongodb.net/myFirstDatabase?retryWrites=true&w=majority|
> When my app tries to log, the mongodb connection keeps stalling in the 
> 30000ms timeout waiting for the cluster description.
> The strange thing is that my app does other things with this very same 
> MongoDB, so I have coded a MongoDBService class that handles the connection 
> etc...and my code works perfectly using the same driver and the same 
> connection string: no "waiting for cluster description"...



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to