[ https://issues.apache.org/jira/browse/LOG4NET-442?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14154871#comment-14154871 ]
Dominik Psenner commented on LOG4NET-442: ----------------------------------------- >From what I can understand out of the log this indicates that the provider did >pass the check if it is connected and went straight to the point where it >opens a transaction: at System.Data.Common.DbConnection.System.Data.IDbConnection.BeginTransaction() at log4net.Appender.AdoNetAppender.SendBuffer(LoggingEvent[] events) Whereas it should reconnect a little earlier if this condition holds: if (m_reconnectOnError && (m_dbConnection == null || m_dbConnection.State != ConnectionState.Open)) { LogLog.Debug(declaringType, "Attempting to reconnect to database. Current Connection State: " + ((m_dbConnection==null)?SystemInfo.NullText:m_dbConnection.State.ToString()) ); Thus it is possible that the connection went away just a jiffy after the check and since there is no other call to SendBuffer() it is not possible to determine if log4net tried to reconnect. Would you please retry your test? My best bet at the moment is that the provider tries to handle the disconnection internally and does thus not report the broken connection state at m_dbConnection.State. Can you debug this? Please note also that connection timeouts can take quite a long time (even more than a few minutes) and thus you may have to send log events for quite a long time before log4net gets a turn to finish the previous SendBuffer and do the next call to SendBuffer. > ReconnectOnError > ----------------- > > Key: LOG4NET-442 > URL: https://issues.apache.org/jira/browse/LOG4NET-442 > Project: Log4net > Issue Type: Bug > Components: Builds > Affects Versions: 1.2.13 > Environment: Microsoft .NET 4.5 > Reporter: Alessio Sanguineti > Attachments: log4net.txt > > > Hello, in our .NET application using Log4Net to log on a Sql Server 2014 > database, we set the parameter "ReconnectOnError" to true in the ADO.Net > Appender configuration. > Even if the property seems to be read correctly (as visible on the log), > whenever the server is not reachable for a while the appender does not > reconnect anymore thus not logging anything else. > We get the log file attached of a test where we turned off SQL Server for > about 1 minute before restarting it. > Thank you. > Regards -- This message was sent by Atlassian JIRA (v6.3.4#6332)