Examples: OpenNotesLog method

  1. This script opens AGENTLOG.NSF on the current computer. Each time an action or error is logged, a new document gets created in .AGENTLOG.NSF
    Dim currentLog As New NotesLog( "Database log" )
    Call currentLog.OpenNotesLog( "", "agentlog.nsf" )
    '...log some actions and errors...
    Call currentLog.Close
  2. This script searches the Domino® data directory of the current computer to find the first database that inherits its design from the StdR4AgentLog template. When the script finds the database, it opens the database for logging.
Dim currentLog As NotesLog
Dim directory As NotesDbDirectory
Dim db As NotesDatabase
Dim done As Variant
Set currentLog = New NotesLog( "Database log" )
Set directory = New NotesDbDirectory( "" )
Set db = directory.GetFirstDatabase( DATABASE )
done = False
While Not ( db Is Nothing ) And Not done
  Call db.Open( "", "" )
  If ( db.DesignTemplateName = "StdR4AgentLog" ) Then
    done = True
    Set db = directory.GetNextDatabase
  End If
Call currentLog.OpenNotesLog( db.Server, db.FilePath )
'...log some actions and errors
Call currentLog.Close