[ https://issues.apache.org/jira/browse/LOG4NET-178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14589323#comment-14589323 ]
Kamran commented on LOG4NET-178: -------------------------------- Removing immediateFlush property doesn't effect anything. What I see is following Last error after which error logging stops log4net:ERROR [AdoNetAppender] ErrorCode: GenericFailure. Exception while writing to database MySql.Data.MySqlClient.MySqlException: Fatal error encountered during command execution. ---> System.IO.IOException: Unable to write data to the transport connection: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size) --- End of inner exception stack trace --- at MyNetworkStream.HandleOrRethrowException(Exception e) at MyNetworkStream.Write(Byte[] buffer, Int32 offset, Int32 count) at MySql.Data.MySqlClient.TimedStream.Write(Byte[] buffer, Int32 offset, Int32 count) at MySql.Data.MySqlClient.MySqlStream.SendPacket(MySqlPacket packet) at MySql.Data.MySqlClient.NativeDriver.ExecutePacket(MySqlPacket packetToExecute) at MySql.Data.MySqlClient.NativeDriver.SendQuery(MySqlPacket queryPacket) at MySql.Data.MySqlClient.Driver.SendQuery(MySqlPacket p) at MySql.Data.MySqlClient.Statement.ExecuteNext() at MySql.Data.MySqlClient.PreparableStatement.Execute() at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) --- End of inner exception stack trace --- 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.BeginTransaction() at log4net.Appender.AdoNetAppender.SendBuffer(LoggingEvent[] events) > Log4Net stops logging after appdomain recycle of ASP.NET2.0 application > ----------------------------------------------------------------------- > > Key: LOG4NET-178 > URL: https://issues.apache.org/jira/browse/LOG4NET-178 > Project: Log4net > Issue Type: Bug > Components: Appenders > Affects Versions: 1.2.10 > Environment: Windows server 2003 > Reporter: Richard Nijkamp > Assignee: Dominik Psenner > Fix For: 1.2.12 > > > Dear sir/madam, > We are using Log4Net 1.2.10. We encounter the problem that Log4net doesn't > continue logging after an event that triggers an appdomain recycle/restart. > In the global.asax we start the logging with: > private static readonly ILog log = > LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); > Logging works flawless when the application is started for the first time. > After sometime it might occur that the appdomain gets recycled due to > inactivity of the web application. We use the following code in > Application_end(): > log.Info("*** Application end ***"); > log4net.LogManager.Shutdown(); > After this function the application gets restarted and the > Application_start() method executes and writes new lines to the log. The > problem is that the log4net doesn't write the new lines after the restart. > Could you explain why log4net might stop working after an appdomain restart > of an asp.net2.0 web application? If I want log4net to work properly again I > need to restart IIS manually. > Looking forward to your reply. > Best regards, > Richard Nijkamp -- This message was sent by Atlassian JIRA (v6.3.4#6332)