What it is…? Logging is the practice of recording sequential data, often chronologically.
How it is useful? Generally, all exception are logged in to file so that at the time of reprogramming / development, a programmer will read log file and will come to know problems occurred.
skv.LogToFile.dll developed my me…
Purpose to Develop: I generally develop the small GUI for DB management with DAO for my friends to manage their small needs in easier manner, many times they told that application struck at middle but when i restart it it works.
I’m not professionals in the Programming, though i would tie-up my ideas to the recent tech as much as possible…
When i ask them what is your last action before that happen they can explain me but not that much easier to trace errors. So i begin to log each important action with try catch in file with MS.VB.Logging but as said above, many times i struggled due maximum size error and customisation for each application so i decide to develop one.
MS.VB.Logging: Provides varieties of options but all to be set for each time and also file size to be controlled externally.For that we have to check the log file with IO’s file system.
What i done: Simply used the IO’s file system and log the message/exception to the file and also check the file limits with the same. Also Raise the event by which log success can be checked with handled exception of library.
What to give: Only thing to give is the message or exception
How it formatted: the log stored in the common separated format (csv) so it easy to access with simple editor.
Options: Most of the options of MS.VB.Logging where provided in addition to that file size checking also added. by default it displays the log to user after logging, it can be disabled with by setting values to properties.It stores the log to application folder with subfolder log ({Application path}\Log\) and with its default name(log_file.log).
List of Members:
Download Link
Dual Licensed : GNU GPL 3.0 or Later and CC by-na 2.5 IN or Later
Example:
Imports skv.LogToFile
Public Class frmMain
Private WithEvents Logger As New LogToFile
Private Sub z()
Try
Throw New DivideByZeroException
Catch ex As Exception
Logger.WriteToLogFile("Ex.Occurred")
Logger.WriteToLogFile(ex)
End Try
End Sub
Private Sub LoggerCalled(ByVal Reply As LogToFile.LogReply) Handles Logger.LogUpdated
If Reply = LogToFile.LogReply.success Then Me.RichTextBox1.Text = System.IO.File.ReadAllText(Logger.FullFilePath)
End Sub
When the DisplayMessageBox Property Set to True then it displays the message/exception logged.
Logger.DisplayMessageBox = True
Performance: Logged 10000 continuous log exception in approx 4min (as with my system configuration) with file size restriction to 1024 bytes.
- Start:15 July 2009,22:48:16
- End:15 July 2009,22:52:10
Logged 100 exception within a ten with same restriction.
- Start:15 July 2009,23:23:49
- End:15 July 2009,23:23:56
Initial logging without restriction was less than half the above time taken.
How it Checked:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.ToolStripProgressBar1.Value = 0
Me.ToolStripProgressBar1.Maximum = 10001
For index As Long = 1 To 10000
z()
Me.ToolStripProgressBar1.PerformStep()
Next
End Sub
