Click here to Skip to main content
13,353,706 members (63,975 online)
Click here to Skip to main content
Add your own
alternative version


28 bookmarked
Posted 6 Aug 2009

Text Log Viewer

, 19 Aug 2009
Rate this:
Please Sign up or sign in to vote.
Text Log Viewer


Log viewer is a very simple and easy to use real time log file viewer. All that is required is to open a text based log file, this program will check for any changes to the file and automatically display them on the screen. 

In the settings part, you can find the highlight and icon options. With these options, you can determine the line color, backcolor or display icon for the criteria that you mentioned.

Log viewer displays only the last 100 (optional) lines for the log. This setting can be shown in the Log windows and can be incremented. For the developers opacity settings is included for those who want to see transparent Log Window. In the project, you will find directory watcher that watches directory and files for the changing. In this part, you can tail the changed files and you can open with one click.

This is the first version of the Log viewer and written in half a day. If you don't mind, please give feedback to improve. 

There are too many utilities like this one. BUT I just want to share this open source - advertisement free utility for free. If you like it, just use it and suggest some pretty options.


Many of the applications write their log in a text based file. In all of my application, every step or critical function has a log option and I view these logs in runtime in test or real time working. I created this component for just that purpose.

Using the Code

Log Viewer using threads for viewing files. You can open multiple files with drag drop.

Dim s_SatirSayisi As Long = 0

    Dim a As New System.IO.FileInfo(Dosya.DosyaTamYol)
    If Not (a.Exists) Then
        Exit Do
    End If

    If Dosya.DosyaSonboyut <> a.Length Then

        If Dosya.DosyaSonboyut > a.Length Then
            Dosya.DosyaSonboyut = 0
        End If


        Dim veri() As String = DosyaOku(Dosya.DosyaTamYol, Dosya.DosyaSonboyut)
        Dosya.DosyaSonboyut = a.Length
        s_SatirSayisi = s_SatirSayisi + veri.Length

    End If


Loop While Cls_Aktif

This thread is the main function that views the log files.

Points of Interest

The DataGridView is used for viewing the logs for each line with highlight and icon option. With this option, you can watch the file easily and I uninstall other log viewers. ;)

In this project, you will find:

  • Threading
  • Open and Read File
  • Datagridview usage
  • File System Watcher Usage
  • Registry Usage
  • XML Usage


  • .NET Docking Library for Windows Forms used for tab views (WeifenLuo.WinFormsUI.Docking)
  • XML+ Library (by Seyfettin Öztürk)


  • Initial release


  • Find option (waiting)
  • Windows Event Log Viewing (Log Number After Max record is not changing, will be fixed)
  • Multi Language Support (GUI, only in English now)



This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Turkey Turkey
No Biography provided

You may also be interested in...

Comments and Discussions

QuestionNice post Pin
Tridip Bhattacharjee13-Dec-13 0:09
memberTridip Bhattacharjee13-Dec-13 0:09 
GeneralMy vote of 2 Pin
josetaza29-Jan-10 1:29
memberjosetaza29-Jan-10 1:29 
General[My vote of 2] ok article Pin
Donsw12-Sep-09 17:18
memberDonsw12-Sep-09 17:18 
GeneralExcellent ! but it adds only new line. Pin
omkarmango27-Aug-09 8:20
memberomkarmango27-Aug-09 8:20 
The utility adds only new line.
please modify it to read whole file everytime so that it can be used for many purposes.
It will be better also if data is resorted after every refresh.

thanx Smile | :)
GeneralInteresting Pin
Johnny J.6-Aug-09 23:26
memberJohnny J.6-Aug-09 23:26 
GeneralRe: Interesting Pin
özk@n17-Aug-09 23:28
memberözk@n17-Aug-09 23:28 
HightechRider6-Aug-09 14:23
memberHightechRider6-Aug-09 14:23 
GeneralRe: Try BARETAIL.EXE Pin
Johnny J.6-Aug-09 23:29
memberJohnny J.6-Aug-09 23:29 
GeneralRe: Try BARETAIL.EXE Pin
HightechRider7-Aug-09 6:08
memberHightechRider7-Aug-09 6:08 
GeneralSeems to be very functional, but ... Pin
Martin08156-Aug-09 7:54
memberMartin08156-Aug-09 7:54 
GeneralRe: Seems to be very functional, but ... Pin
mot2566-Aug-09 9:36
membermot2566-Aug-09 9:36 
GeneralRe: Seems to be very functional, but ... Pin
Martin08156-Aug-09 22:56
memberMartin08156-Aug-09 22:56 
GeneralRe: Seems to be very functional, but ... Pin
özk@n17-Aug-09 23:29
memberözk@n17-Aug-09 23:29 
GeneralRe: Seems to be very functional, but ... Pin
Martin081518-Aug-09 0:38
memberMartin081518-Aug-09 0:38 

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.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.180111.1 | Last Updated 20 Aug 2009
Article Copyright 2009 by özk@n
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid