Making a log

The Log 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 Domino® database for logging. Each log entry is a 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 events on the network.

The following methods access the Log properties:

  • isLogActions returns true if action logging is enabled; setLogActions sets this property to true (default) or false to enable or disable action logging.
  • isLogErrors returns true if error logging is enabled; setLogErrors sets this property to true (default) or false to enable or disable error logging.
  • isOverwriteFile returns true if existing files are written over rather than appended to; setOverwriteFile sets this property to true or false (default) to enable or disable file overwriting.
  • getNumActions returns an int value containing the number of actions logged so far.
  • getNumErrors returns an int value containing the number of errors logged so far.
  • getProgramName returns a String value containing the name of the script to which the entries apply; setProgramName sets this property.
  • getParent returns a Session object representing the current session.