ReconnectOnError Property

log4net SDK Reference |

# AdoNetAppender.ReconnectOnError Property

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

[Visual Basic]
Public Property ReconnectOnError As Boolean
[C#]
public bool ReconnectOnError {get; set;}

#### Property Value

`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

AdoNetAppender Class | log4net.Appender Namespace