Click here to Skip to main content
Licence CDDL
First Posted 1 Jan 2009
Views 21,085
Downloads 1,628
Bookmarked 51 times

LogViewer - A Simple Log Listening Utility

By dnpro | 1 Jan 2009
Simple log listening utility that listens to logs events from multiple sources, e.g. TCP/UDP, File logs, Remoting channels

1

2
2 votes, 16.7%
3
2 votes, 16.7%
4
8 votes, 66.7%
5
4.81/5 - 12 votes
2 removed
μ 4.52, σa 1.40 [?]
NLog_Client

Introduction

Over the years that I have spent as a software developer, I have realized the essence of perfect logging in application development. As part of development, writing logging statements seems to be chaotic task, although it gives a perfect solution while debugging applications especially in production environment (where we don't even have a simple CLR debugger). 

In context of production debugging logging proves a metal over other strategies, because logging becomes the only way to communicate the process that is going under the hood (application). We can neither set a debug watch nor may we have a break point to stop execution at a certain point of time. Although we may use debug.assert statement, again it is not very convenient. Altogether in my experience application seems like a black box, having no stiff controls over the execution. 

The Problem

Now, I would like to give a brief about the motivation behind the article. It is perfectly justified that one may start using logging for the sake of debugging the application, but at the same time some sort of tools must exist to evaluate the logs while the application is running. In my point of view, I am interested in a tool that serves the following commitments:

  1. It must support listening of log events from log file(s).
  2. It must support listening of log events over network, i.e. TCP or UDP port.
  3. It must support listening of log events on remoting channels.
  4. And the most important, it must belong to open source and come with the complete source.

I altogether agree that there might be some more criteria to evaluate a log listening utility, but all the above criteria are the ones that I was most concerned about.

Solution

I hope you are following the article until now, and it seems that there is a necessity of a utility that can provide an intuitive User interface and multiple ways to listen to log events from multiple sources.

Hence I researched this topic and came to a decisive list of following utilities:

I would like to appreciate all the above utilities, but none of the above were suited to my requirements because of the following reasons:

  • Some are too restrictive in the sense of supporting customization.
  • Some are coming from the Java world, and one must know some Java basic to use them.
  • Some need their own configuration settings to be maintained.
  • And lastly, some are commercial, and do not support listening from multiple sources at same time in freeware edition.

After all this tooth gnashing exercise, I decided to go with my own implementation. Because that was the only resort left for me, and after all I need to believe in my skills (Yes, I can do this).    

Aftermath, there is good news that after an overwhelming exercise with my PC and burning some midnight oil while reading some texts, I devised a working and stable application. I am heavily using this application for all of my logging needs. Now I would like to give some heads-up about the utility which I am discussing. Well the utility I developed is known as LogViewer - A Simple log listening utility and it supports the following behavior:

  1. Listening of log events from log file. (It is implemented using FileSystemWatcher component, thanks to .NET Framework team).
  2. Listening of log events over TCP protocol. (For supporting NLog NetworkTarget. It is implemented using System.Net.Sockets, again thanks to .NET framework team).
  3. Listening of log events over UDP protocol. (For supporting log4net UdpAppender and NLog NetworkTarget, thanks to log4net contributors).
  4. Listening on log events over Remoting channel (For supporting log4net RemotingAppender, thanks to log4net contributors).

From the above description, it is pretty much clear that it is a simple log event listening utility that supports listening of log events from multiple sources, that too simultaneously. The remaining functionality will become much clearer when you start using it.

Well that's all folks.

"Have a promising and fulfilling new year"

Please forward your suggestions to me, and please vote for this article if you like this utility.

Credits

I would like to extend the credits of this article to the following open source logging frameworks:

  1. Log4Net

  2. NLog

DISCLAIMER

THIS UTILITY IS NOT FOLLOWING ANY STANDARD DESIGN PATTERN AND IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.   

History 

  • Initial revision 1.0 on Jan 02 2009

License

This article, along with any associated source code and files, is licensed under The Common Development and Distribution License (CDDL)

About the Author

dnpro

Software Developer
Freelance Developer
India India

Member
He has done Masters in Software Engineering from UPTU Lucknow, India.. He is having work experience of 3.5+ years as Senior Software Developer with Atlanta(US) based Software Product Development company. He started his career with PASCAL, then moved to C and finally got into VB 5.0 and now enjoys programming into C#. He loves to works on Enterprise software development using ASP.NET, MOSS and SQL Server. Withal he is proficient in Tool development and System Integration. He is advocate of Open source and love to share solutions with open source communities like nHibernate, SubSonic, SourceForge.
 
Award's :
Prize winner in Competition "Best VB.NET article of May 2008"
 
Ashu' Articles :
Click to see my CodeProject Articles
 
Ashu's Blog :
Share a solution | Explore the .NET world
 
Ashu's Favorite :
nHibernate - The best ORM.
nHibernate Contributed Tools
SubSonic - Best Auto generated DAL.
 

Click to send me your wishes :ashufouzdar@.in.com


Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
Generalgood article PinmemberDonsw17:10 16 Feb '09  
GeneralRe: good article Pinmemberdnpro19:35 16 Feb '09  
GeneralNice one PinmvpAbhijit Jana21:20 9 Feb '09  
GeneralRe: Nice one Pinmemberdnpro22:52 9 Feb '09  
GeneralGood stuff PinmemberDr.Luiji6:52 7 Jan '09  
GeneralRe: Good stuff Pinmemberashu fouzdar20:07 7 Jan '09  
GeneralNice tool PinmemberRon440774:35 6 Jan '09  
GeneralRe: Nice tool Pinmemberashu fouzdar20:43 6 Jan '09  
GeneralMore customization Pinmembermetalsandman23:31 4 Jan '09  
GeneralRe: More customization Pinmemberashu fouzdar3:19 5 Jan '09  
GeneralTraceTool Pinmemberzlezj2:27 3 Jan '09  
GeneralRe: TraceTool Pinmemberashu fouzdar20:32 4 Jan '09  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web02 | 2.5.120209.1 | Last Updated 2 Jan 2009
Article Copyright 2009 by dnpro
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid