Click here to Skip to main content
14,331,628 members

LogViewer - A Simple Log Listening Utility

Rate this:
4.81 (16 votes)
Please Sign up or sign in to vote.
4.81 (16 votes)
1 Jan 2009CDDL
Simple log listening utility that listens to logs events from multiple sources, e.g. TCP/UDP, File logs, Remoting channels
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

    Image 2
  2. NLog

    Image 3

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)

Share

About the Author

Ashutosh Phoujdar
Architect Infosys Technologies Ltd.
India India
An Software Architect having work experience of 8+ years in Architecture, Design and Development of Enterprise class application for Analytic s and Business Intelligence. Having hands-on experience primarily in Microsoft Technology Stack including(but not limited to) .NET, SQL Server, SharePoint Server, Biztalk, Withal know to program in Java, Perl and Shell. Currently working as Product Technical Architect in Infosys Technologies Ltd. Products R&D division. He has worked on development of best in class Supply Chain Optimization System and Spend Classification Software for optimizing indirect spend. An avid programmer by heart and passionate for solving any challenging and complex business problems. He is advocate of Open source and love to share solutions with open source communities like
1.Stack Overflow
2. nHibernate
.

Award's :
Prize winner in Competition "Best article of May 2008"

Articles :
Click to see my CodeProject Articles

Open Source Contributions:
Click to see my Open Source Project

Blog :
Share a solution | Explore the .NET world

Link'd :
LinkedIn Profile

His Favorite(s) :
nHibernate - The best ORM.
nHibernate Contributed Tools

Comments and Discussions

 
PraiseCleanest code ever Pin
Member 89700106-Jun-18 13:03
memberMember 89700106-Jun-18 13:03 
QuestionUDP multi Log Pin
Hacko12323-Jun-15 5:42
memberHacko12323-Jun-15 5:42 
BugINFO lines are shown in the wrong color Pin
Member 1039517011-Nov-13 16:38
memberMember 1039517011-Nov-13 16:38 
GeneralMy vote of 5 Pin
Member 275996326-Jun-12 20:54
memberMember 275996326-Jun-12 20:54 
Generalgood article Pin
Donsw16-Feb-09 16:10
memberDonsw16-Feb-09 16:10 
GeneralRe: good article Pin
Ashutosh Phoujdar16-Feb-09 18:35
professionalAshutosh Phoujdar16-Feb-09 18:35 
GeneralNice one Pin
Abhijit Jana9-Feb-09 20:20
mentorAbhijit Jana9-Feb-09 20:20 
GeneralRe: Nice one Pin
Ashutosh Phoujdar9-Feb-09 21:52
professionalAshutosh Phoujdar9-Feb-09 21:52 
GeneralGood stuff Pin
Dr.Luiji7-Jan-09 5:52
professionalDr.Luiji7-Jan-09 5:52 
GeneralRe: Good stuff Pin
Ashutosh Phoujdar7-Jan-09 19:07
professionalAshutosh Phoujdar7-Jan-09 19:07 
GeneralNice tool Pin
Ron440776-Jan-09 3:35
memberRon440776-Jan-09 3:35 
GeneralRe: Nice tool Pin
Ashutosh Phoujdar6-Jan-09 19:43
professionalAshutosh Phoujdar6-Jan-09 19:43 
GeneralNot working? Pin
jumper7772-Jun-16 4:42
memberjumper7772-Jun-16 4:42 
GeneralRe: Not working? Pin
Jasonblack197621-May-17 6:28
memberJasonblack197621-May-17 6:28 
GeneralMore customization Pin
metalsandman4-Jan-09 22:31
membermetalsandman4-Jan-09 22:31 
GeneralRe: More customization Pin
Ashutosh Phoujdar5-Jan-09 2:19
professionalAshutosh Phoujdar5-Jan-09 2:19 
GeneralTraceTool Pin
zlezj3-Jan-09 1:27
memberzlezj3-Jan-09 1:27 
GeneralRe: TraceTool Pin
Ashutosh Phoujdar4-Jan-09 19:32
professionalAshutosh Phoujdar4-Jan-09 19:32 

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

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

Article
Posted 1 Jan 2009

Stats

65.9K views
7.7K downloads
84 bookmarked