Logging Levels
There are seven logging levels, five of which can be called in your code. They are as follows (with the highest being at the top of the list):
- OFF - nothing gets logged (cannot be called)
- FATAL
- ERROR
- WARN
- INFO
- DEBUG
- ALL - everything gets logged (cannot be called)
These levels will be used multiple times, both in your code as well as in the config file. There are no set rules on what these levels represent (except the first and last).
Log4Net Tutorial in C# .net (How can I show log in a file?)
For logging service my choice is log4net from Apache Software Foundation. It is easy to use, open source and well documented. There are also so many logging services but they are not open source. So it is an easy and best solution for you.
Write Log in Console procedures are given below-
2. Open visual studio and create a new console application.
3. Add to the project a reference to the \bin\net\2.0\release\log4net.dll assembly in the log4net distribution.
4. write the main method like this
Comments
Post a Comment