Hello I am Basmah, Undergraduate student. I need your help in the following scenario.
I have four appenders namely as follows
appender name= LogFileAppender // to write general logs in File
appender name=LogDatabaseAppender// to write general logs in db via Oracle StoredProc
appender name=ExceptionFileAppender // to write exception logs in File
appender name=ExceptionDatabaseAppender // to write exception logs in db via Oracle StoredProc
I want to have a appconfig file where I can set which appender to use. Moreover , I have methods as follows Method_WriteLogOnly ---> which will use appender 1 or 2 Method_WriteExceptionLogs---> which will use appender 3 or 4
Problem is I dont know if I am using the same log4net.config.xml file for both the methods , then how to set the appender .
What is the best practice , either to set appender programmatically or through another configuration place like if I have an app.config or web.config file , and there I write a key value pair (some sort of code like this) for choosing the appender ? Please guide me with code guidelines. Thankyou