Logging Services for .net - log4net

1,932 views
1,798 views

Published on

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,932
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
49
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Logging Services for .net - log4net

  1. 1. Albert Kuo
  2. 2. <ul><li>Introduction </li></ul><ul><li>Features </li></ul><ul><li>Configuration </li></ul><ul><ul><li>Import log4net DLL </li></ul></ul><ul><ul><li>Create config.xml </li></ul></ul><ul><ul><li>Set Log4Net.xml file path </li></ul></ul><ul><ul><li>Insert log requests into the application code </li></ul></ul><ul><li>Reference </li></ul>
  3. 3. <ul><li>log4net is a tool to help the programmer output log statements to a variety of output targets. log4net is a port of the excellent log4j framework to the .NET runtime. </li></ul><ul><li>http://logging.apache.org/log4net/index.html </li></ul>
  4. 4. <ul><li>Support for multiple frameworks </li></ul><ul><ul><li>log4net runs on all ECMA CLI 1.0 compatible runtimes. log4net has specific builds for the following frameworks: </li></ul></ul><ul><ul><ul><li>Microsoft .NET Framework 1.0 (1.0.3705) </li></ul></ul></ul><ul><ul><ul><li>Microsoft .NET Framework 1.1 (1.1.4322) </li></ul></ul></ul><ul><ul><ul><li>Microsoft .NET Framework 2.0 (2.0.50727) </li></ul></ul></ul><ul><ul><ul><li>Microsoft .NET Compact Framework 1.0 </li></ul></ul></ul><ul><ul><ul><li>Mono 1.0 </li></ul></ul></ul><ul><ul><ul><li>Mono 2.0 </li></ul></ul></ul><ul><ul><ul><li>Microsoft Shared Source CLI 1.0 </li></ul></ul></ul><ul><ul><ul><li>CLI 1.0 Compatible </li></ul></ul></ul>
  5. 5. <ul><li>Output to multiple logging targets </li></ul><ul><ul><li>log4net.Appender.AdoNetAppender </li></ul></ul><ul><ul><ul><li>Writes logging events to a database using either prepared statements or stored procedures. </li></ul></ul></ul><ul><ul><li>log4net.Appender.ConsoleAppender </li></ul></ul><ul><ul><ul><li>Writes logging events to the application's Console. </li></ul></ul></ul><ul><ul><li>log4net.Appender.RollingFileAppender </li></ul></ul><ul><ul><ul><li>Writes logging events to a file in the file system. The RollingFileAppender can be configured to log to multiple files based upon date or file size constraints. </li></ul></ul></ul><ul><li>For more information about appenders, please check: http://logging.apache.org/log4net/release/features.html </li></ul>
  6. 6. <ul><li>XML Configuration </li></ul><ul><ul><li>log4net is configured using an XML configuration file. The configuration information can be embedded within other XML configuration files (such as the application's .config file) or in a separate file. </li></ul></ul><ul><ul><li>The configuration is easily readable and updateable while retaining the flexibility to express all configurations. Alternatively log4net can be configured programmatically. </li></ul></ul>
  7. 7. <ul><li>Proven architecture </li></ul><ul><ul><li>log4net is based on the highly successful log4j logging library, in development since 1996. This popular and proven architecture has so far been ported to 12 languages. </li></ul></ul>
  8. 8.
  9. 9.
  10. 10. Concerning conversationPattern, please check: http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PatternLayout.html
  11. 11.
  12. 12.
  13. 13. Log level
  14. 14. ConsoleAppender
  15. 15. RollingFileAppender
  16. 16. <ul><li>Official site: </li></ul><ul><ul><li>http://logging.apache.org/log4net/index.html </li></ul></ul><ul><li>Log4net download url: </li></ul><ul><ul><li>http://logging.apache.org/log4net/download.html </li></ul></ul><ul><li>Using log4net: </li></ul><ul><ul><li>http://ondotnet.com/pub/a/dotnet/2003/06/16/log4net.html </li></ul></ul>

×