|
-
May 14th, 2004, 04:21 PM
#1
Thread Starter
Member
compare two logging methods
Hi, All,
So far I know two ways to log error message (as follows). I wish to know which is more stable.
Method 1 is provided by VB, it sounds better, but it causes my application behave unexpectedly sometimes(maybe I use it incorrectly). I wish to know your preference and your suggestion if you would like drop some lines.
Thank you very much!! Have a good weekend!
Method 1:
App.StartLogging "MyLogFilePath", 2
App.LogEvent "MyMessage", vbLogEventTypeInformation
Method 2:
Public Sub LogEvent ( ErrorMessage As String)
Dim FileNumber As Long
FileNumber = FreeFile
Open "\Error.log" For Append As #FileNumber
Print #FileNumber, ErrorMessage
Close #FileNumber
End Function
Call this method when needed.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|