views:

20

answers:

1

I have a log4net ado appender writing to a SQL Server database. I like it, I think it's neat. Before I send it into production, I want to know what the behaviour will be if the database goes down.

I don't want the application to stop because the logging database is unavailable. I am presuming that log4net will just silently fail and not do anything, at least that's what I'm hoping. Can anyone confirm this or (better) point me to some documentation that will confirm this?

+1  A: 

The appender (like all log4net appenders that I am aware of) will fail silently and thus stop logging. You can configure the appender to try to reconnect though:

<reconnectonerror value="True" />

In that case you probably want to specify a connection time out in your db connection string:

Connect Timout=1

If you do not do that your application will be very slow if the db is offline.

Stefan Egli