admin管理员组

文章数量:1395137

I have Windows Service, written on the Framework 4.8, which writes logs with log4net, version 3.0.3. log4net writes at the same time in the local file on the server, and in the sql db with log4net.Appender.Adonetappender. After starting the service, for some time everything works as it should, but then suddenly he will stop writing into the database, although they continue to writes in the logs file. There are no errors in the Event Viewer, not on the server itself or on sql server. After restarting the service, everything works again, but then it is interrupted again, to track some legality when this happens, I could not, sometimes this happens after 1/2 hours, and sometimes after 2 days.

The configuration is like this:

<appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender">
        <bufferSize value="1" />
        <connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
        <connectionString value="data source=SQL-Serv1;initial catalog=MyDataCatalog;integrated security=false;persist security info=True;User ID=aaa;Password=bbb;" />
        <commandText value="INSERT INTO Log ([Date],[Thread],[Level],[Logger],[Message],[Exception],[Guid],[Method]) VALUES (@log_date, @thread, @log_level, @logger, @message, @exception, @guid, @method)" />

What could be a problem?

本文标签: log4net stops writing to the dbStack Overflow