log4net to SQLServer : what happens if database is unavailable?

前端 未结 3 1579
挽巷
挽巷 2020-12-10 06:13

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

3条回答
  •  孤街浪徒
    2020-12-10 06:58

    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:

    
    

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

    Connect Timeout=1
    

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

提交回复
热议问题