NotesLog (LotusScript®)

Enables you to record actions and errors that take place during a script's execution. You can record actions and errors in:

  • A Domino® database
  • A mail memo
  • A file (for scripts that run locally)
  • An agent log

Containment

Contained by: NoteSession

Properties

LogActions

LogErrors

NumActions

NumErrors

OverwriteFile

Parent

ProgramName

Methods

Close

LogAction

LogError

LogEvent

New

OpenAgentLog

OpenFileLog

OpenMailLog

OpenNotesLog

Creation

To create a new log, you can use:

  • New
Note: The New method is not supported in COM.
  • CreateLogMethod in NotesSession

Syntax

Dim variableName As New NotesLog( programName$ )

OR

Set notesLog = New NotesLog( programName$ )

Parameters

programName$

String. A name that identifies the log.

Usage

Once you create a log using New, you use one of the following methods to open it before you begin logging:

  • To log to a database, use the OpenNotesLog method.
  • To log to a mail memo, use the OpenMailLog method.
  • To log to a file (only available to scripts running locally), use the OpenFileLog method.
  • To log to an agent log, use the OpenAgentLog method. This method only works if used from an agent script.

You must explicitly log each action and error using the following methods:

Domino® does not automatically log actions or errors for you.

The Print statement writes to an Events document ("Miscellaneous Events" view) in the LOG.NSF database where the code executes for:

  • Scheduled agents
  • Agents started by Run or RunOnServer

Example