1
Answer

How to save error logs

Ask a question
Please help !

This code must be written in C#. 


Problem:

In a application we need to generate Application Logs. So we want you to write a Logger module in C# which should be capable to write logs to file system and other sources like XML file or database. Please keep in mind following aspects while creating this module. 

1. Logger module should be Singleton. 
2. Logger module should be Thread Safe.
3. Logger module should provide why to log different type of logs like DEBUG, INFO, WARN and ERROR
4. Logger module should be extentable to add various logs destination(e.g XML, DB, System Event Logs) in future if need be. 
5. For now you can implement only File base logger. 
6. We should be able to set the log level based so logger will capture only desired (INFO, WARN etc) logs. 


Answers (1)