2

I know it's possible to log in both file and database and also in more than one resource,but is there any way to configure log4net if it failed to log in the database it log to the file automatically?

Community
  • 1
  • 1
Reza M.A
  • 1,197
  • 1
  • 16
  • 33
  • @DeanWard in his answer,he said: "I don't think you can do this by configuration.", and he is not sure is it possible or not, let this question be open until it's real answer. – Reza M.A Jul 07 '14 at 10:09
  • 2
    Gah, I linked to the wrong answer - there's a [`FallbackAppender`](https://code.google.com/p/log4netcontrib/wiki/FallbackAppender) that you should investigate. Sorry, I'll remove my dupe flag... – Dean Ward Jul 07 '14 at 10:11
  • You could write a wrapper for log4net, which checks for some database error (connection down, access problems etc), then log to file, otherwise log to database. – scheien Jul 07 '14 at 11:02

0 Answers0