Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Is there way to configure the log4net is such a way that, if the database is down or could not able to connect to database exceptions should log into file(only if the database is having problem). Currently i am able to write for both database and file.

What I have tried:

Currently i am able to write for both database and file.
Posted
Updated 16-Dec-18 10:09am
Comments
Rajeev Jayaram 14-Dec-18 7:41am    
Have you read the manual? https://logging.apache.org/log4net/release/manual/configuration.html

1 solution

You could try to change the configuration programmatically, but this does not seem to be an easy feat to accomplish, here are some examples:

David's Weblog » Changing log4net threshold and levels programmatically during runtime[^]

Change log4net logging level programmatically – Nishant Rana's Weblog[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900