Welcome to Perth .NET Community of Practice Sign in | Join | Help

Using an open source tool for application logging in .Net

Boy, I've made the mistake of showing an interest in the .NET Compact Framework and Nick's on my back to get out there and blog away!

So here I am with my first blog and not having copious amounts of time I think it's time to get stuck in.

I've been coding away for the last 5/6 years in java and mainly using open source products such as JBoss and Eclipse.  One of the most useful open source tools that I have ever used is an open source product called log4j.  Prior to logging being part of the Java API, this tool was embraced by many developers in the Java community and infact over the years it has been ported to a number of different environments.

e.g

  • Log4cxx Homepage - A port for C++
  • Log4cplus Homepage - Another port for C++
  • dlib C++ library Homepage - Contains yet another port for C++
  • Log4c - A port for C
  • Log4perl - A port for Perl
  • Log4js - A port for JavaScript
  • logging - The official logging module for Python inspired by log4j.
  • Log4r - Ruby logging module inspired by log4j
  • Log4net - A port to the Microsoft .NET Framework
  • log4php a port for PHP
  • I have longed to come back to the MS world (having spent a few years away - yes I was once an avid VB programmer) and recently we have started looking at the .NET framework for mobile devices and potential for the desktop.  Traditionally we have been an open source Java software company developing a number of mobile systems in the Mining and Utilities sector using our own in-house mobile database, java skins and various other toolsets.

    I'll admit that I am very green when it comes to coding in C# and the .NET compact framework, but one of the areas we really wanted to get up and running quite quickly in our .NET applications was that of logging.  In a world where asyncronous transactions dominate and various components (Pocket PC, Gateways, Interaction Servers) process messages to different Client Enterprise Systems such as SAP etc we wanted a common approach to logging. 

    It was great to grab the .net port of log4j, write a simple C# wrapper to simulate our log4j wrapper in our java environment and before I knew it we were logging to an almost exact logging API across all our applications.

    I'll let you look at the features of log4net, but I cannot give enough praise to how powerful this open source product is.

    It's early days yet for us using log4net as we have only just started down the .NET road.  In fact I don't even know what others are using for logging in .NET (especially on the Compact Framework side of things), so I would be interested in your comments and feedback regarding logging and what you think of log4net if you get to try it out.

    As a side note - it's very interesting to have come from the Java and Open Source community and back to the ways of Microsoft .  I feel that log4net is only the tip of the iceberg in terms of what benefits can be gained through cross pollination of the two "ways of life".

    Well, that's it for my first blog - Hopefully Nick will be satisfied and I can rest easy this weekend knowing that I am no longer a Blog virgin!

    Regards

    Al.

     


     

     

    Posted by Anonymous | 0 Comments
    Filed under: ,