I wondered what the best way to implement the log4net in my mvc project
My 4 question is:
1. Where the best place to write this code line
public log4net.ILog log = log4net.LogManager.GetLogger("File");
In the controller constructer or before the write event, or else.
2. I want after writing to file to release the file
3. I want give the admin manager the option to select if use the log4net or not, if I add an appsetting value "useLogs" where the best place/way to implement/unimplement this program to my application.
4. After that the file limit I want send the admin an email that the file limit that the admin backup and delete the file (for more disc space) is this option built in the log4net, maybe do It automatically
My step to config the log4net is:
1. Add reference to log4net.dll
2. Add <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
In web.config file
3. Add the log4net config in web.config file
<level value="DEBUG" />
View Complete Post