Friday, May 18, 2012
 
The best way to analyze your logs! Minimize
 Log4Net Mail archive   

The Log4Net mailing list is a great source of information about using log4Net, in this forum we collect all the messages in the log4net user list and some selected threads from the developer list.

Subject: closed connection errors with AdoNetAppender & MySQL Connector/NET
Prev Next
You are not authorized to post a reply.

Author Messages
Chris Jerdonek

09/16/2008 4:20 AM  

Hi,

Has anyone ever experienced frequent "closed connection" errors in
log4net while using the AdoNetAppender with MySQL Connector/NET in an
ASP.NET application (stack traces below)?

I know this isn't strictly a log4net question, but I'm wondering if
anything about log4net might be contributing to the problem.  The error
often happens when the associated app pool is recycled, but it sometimes
happens when no recycle is happening.  Also, even after the error
occurs, it seems that log4net is able to keep logging to the database
from that same process.

I'm using the default value for the ReconnectOnError property, which the
documentation says is false (i.e. log4net should stop logging if the
connection is no longer open).  So it seems like the connection is still
okay.  As further evidence, the database connection ID for the process
is the same before and after the error.

Also, I'm using BufferSize of 1, and the DB connection is via localhost.

Thanks,
--Chris


--
Chris Jerdonek, PhD
Software Developer | Product Development
Granicus, Inc.
w: (415) 357-3618 ext 1357 | c: (415) 286-2238
Changing the way citizens interact with government



�] log4net:ERROR [AdoNetAppender] Exception while writing to
database
�] MySql.Data.MySqlClient.MySqlException: Reading from the stream
has failed. ---> System.IO.IOException: Unable to read data from the
transport connection: An existing connection was forcibly closed by the
remote host. ---> System.Net.Sockets.SocketException: An existing
connection was forcibly closed by the remote host
�]    at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32
offset, Int32 size, SocketFlags socketFlags)
�]    at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32
offset, Int32 size)
�]    --- End of inner exception stack trace ---
�]    at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32
offset, Int32 size)
�]    at System.IO.BufferedStream.ReadByte()
�]    at MySql.Data.MySqlClient.MySqlStream.LoadPacket()
�]    --- End of inner exception stack trace ---
�]    at MySql.Data.MySqlClient.MySqlStream.LoadPacket()
�]    at MySql.Data.MySqlClient.MySqlStream.OpenPacket()
�]    at MySql.Data.MySqlClient.NativeDriver.ReadResult(UInt64&
affectedRows, Int64& lastInsertId)
�]    at MySql.Data.MySqlClient.MySqlDataReader.GetResultSet()
�]    at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
�]    at
MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior
behavior)
�]    at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
�]    at
MySql.Data.MySqlClient.MySqlConnection.BeginTransaction(IsolationLevel
iso)
�]    at
MySql.Data.MySqlClient.MySqlConnection.BeginDbTransaction(IsolationLevel
isolationLevel)
�]    at
System.Data.Common.DbConnection.System.Data.IDbConnection.BeginTransacti
on()
�]    at log4net.Appender.AdoNetAppender.SendBuffer(LoggingEvent[]
events)


�] log4net:ERROR [AdoNetAppender] Exception while writing to
database
�] MySql.Data.MySqlClient.MySqlException: Connection unexpectedly
terminated.
�]    at MySql.Data.MySqlClient.MySqlStream.LoadPacket()
�]    at MySql.Data.MySqlClient.MySqlStream.OpenPacket()
�]    at MySql.Data.MySqlClient.NativeDriver.ReadResult(UInt64&
affectedRows, Int64& lastInsertId)
�]    at MySql.Data.MySqlClient.MySqlDataReader.GetResultSet()
�]    at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
�]    at
MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior
behavior)
�]    at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
�]    at
MySql.Data.MySqlClient.MySqlConnection.BeginTransaction(IsolationLevel
iso)
�]    at
MySql.Data.MySqlClient.MySqlConnection.BeginDbTransaction(IsolationLevel
isolationLevel)
�]    at
System.Data.Common.DbConnection.System.Data.IDbConnection.BeginTransacti
on()
�]    at log4net.Appender.AdoNetAppender.SendBuffer(LoggingEvent[]
events)


You are not authorized to post a reply.
Forums > Log4Net > Log4Net Mail archive > closed connection errors with AdoNetAppender & MySQL Connector/NET



ActiveForums 3.7

 

 

 

 

 

 

 

 

Log4Net Dashboard

Log analysis and monitoring made easy!

Log4Net Dashboard is a log viewer that can read log statements from a variety of logging output targets.

You can download a free developer version.

  

Check it out!

On the demonstration site you can try it  with live data.demo.l4ndash.com - Try Log4Net Dashboard with live data

The mail archive is a copy of all the mail sent to the mail address: log4net-user@logging.apache.org, organized as a forum.

If you would like to participate in the mail list, send a mail to log4net-user-subscribe@logging.apache.org.

More information about the mailing list is available on: http://logging.apache.org/log4net/support.html

 

A complete topic list is available and can be viewed here (warning, it takes some time to load)

 

Copyright 2005-2008 by FaktNet AS Terms Of Use Privacy Statement