Examples: openNotesLog method

This agent opens AGENTLOG.NSF on the current computer. Each time an action or error is logged, a new document gets created in AGENTLOG.NSF.

import lotus.domino.*;
import java.util.Vector;
public class JavaAgent extends AgentBase {
  public void NotesMain() {
    try {
      Session session = getSession();
      AgentContext agentContext = session.getAgentContext();
      // (Your code goes here) 
      Log log = session.createLog("Database log");
      log.openNotesLog(null, "agentlog.nsf");
      log.logAction("Logging an action");
      log.close();
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}