Making a Domino® log

The NotesLog class provides these methods for opening a log:

  • OpenFileLog opens a file for logging.
  • OpenMailLog opens a mail memo for logging. The memo is mailed when the log is closed.
  • OpenNotesLog opens a database for logging. Each log entry is a Domino® document with the items A$PROGNAME, A$LOGTIME, A$USER, A$LOGTYPE, A$ACTION, A$ERRCODE, and A$ERRMSG. Use the system template ALOG.NTF to create databases suitable for logging.
  • OpenAgentLog opens an agent log for logging. This method is valid only in an agent. Each agent has an associated log that is accessible through Agent - Log when the agent is selected.

The Close method closes a log.

These methods make entries in the log:

  • LogAction logs an action.
  • LogError logs an error.

The LogEvent method can be used on servers to generate Domino® events on the network, including events that can be seen by the NotesView product.

The following table lists the NotesLog properties:

Property

Data type

Description

LogActions

Boolean

(Read-write) True to enable action logging; true unless you set it to false

LogErrors

Boolean

(Read-write) True to enable error logging; true unless you set it false

NumActions

Integer

(Read-only) Number of actions logged so far

NumErrors

Integer

(Read-only) Number of errors logged so far

OverwriteFile

String

(Read-write) True to write over an existing file rather than to append; false unless you set it true

Parent

NotesSession

(Read-only) The session that contains a NotesLog object. For COM only.

ProgramName

String

(Read-write) Name of the script to which the entries apply; this string precedes each log entry