Domino Code Fragment

Code Name*
OpenFileLog method
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.3.144.98.13
Description*
2. This agent opens a file called over.TXT in the Notes directory. Each action and error gets appended to the file on a separate line after first writing over the existing contents of the file.
Type*
Java
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
import lotus.notes.*;


public class openfilelog2agent extends AgentBase
{
 public void NotesMain()
 {
   try
   {
     Session s = getSession();
     Log log = s.createLog("Overwrite file");
     log.setOverwriteFile(true);
     log.openFileLog("over.log");
     log.logAction("Logged an action");
   }
   catch (Exception e)
   {
     e.printStackTrace();
   }
 }
}