HanG321 Blog

Log file in both NSF and Text format

Log file in both NSF and Text format
Mr Frunobulax 16.Jan.07 11:33 a Web browser
Domino Server 7.0.2 Windows 2003


You could write your own custom class which simply wraps up a .nsf log and a txt log. Something like this:

?

Class MyLog

Private fileLog As NotesLog
Private dbLog As NotesLog

Sub new( programName As String, dbName As String, fileName As String )

Set fileLog = New NotesLog( programName )
Call fileLog.OpenFileLog( filename )

Set dbLog = New NotesLog( programName )
Call dbLog.OpenNotesLog( "", dbName )

End Sub

Sub logAction( msg As String )

Call fileLog.LogAction( msg )
Call dbLog.LogAction( msg )

End Sub

Sub close()

Call fileLog.Close()
Call dbLog.Close()

End Sub

End Class

You would use the class like this:

Dim myLog As New MyLog( "My Agent", "mylog.nsf", "c:templog.txt" )
Call myLog.logAction( "Hello world" )
Call myLog.close()