AdoNetAppender ReconnectOnError Property | Apache log4net™ SDK Documentation

Should this appender try to reconnect to the database on error.

Namespace: log4net.Appender
Assembly: log4net (in log4net.dll) Version: 2.0.8.0-.NET 4.0
Syntax

C#
VB
C++
F#
Copy

    public bool ReconnectOnError { get; set; }

    Public Property ReconnectOnError As Boolean
    	Get
    	Set

    public:
    property bool ReconnectOnError {
    	bool get ();
    	void set (bool value);
    }

    member ReconnectOnError : bool with get, set

#### Property Value

Type: Boolean
true if the appender should try to reconnect to the database after an error has occurred, otherwise false. The default value is false, i.e. not to try to reconnect.
Remarks

The default behaviour is for the appender not to try to reconnect to the database if an error occurs. Subsequent logging events are discarded.

To force the appender to attempt to reconnect to the database set this property to true.

Note
When the appender attempts to connect to the database there may be a delay of up to the connection timeout specified in the connection string. This delay will block the calling application's thread. Until the connection can be reestablished this potential delay may occur multiple times.

See Also

#### Reference

AdoNetAppender Class
log4net.Appender Namespace