Public Shared Sub Log(ByVal strLogMessage As String)
Try
Dim strWr As StreamWriter = File.AppendText(Environment.CurrentDirectory & "\Logs\" & Date.Now.ToString("MM-dd-yyyy") & ".log")
strWr.WriteLine(DateTime.Now.ToString & " " & strLogMessage)
strWr.Close()
Catch ex As Exception
End Try
End Sub
Basic Datewise Log feature in .NET
Tags:
.Net
Here is the simple log method which logs in file. It will creates log file per day.
Related Posts :
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment