Domino Code Fragment
Code Name* lotus.notes.Log class | Date* 04/29/2024 | Source (or email address if you prefer)* Rlatulippe@romac.com IP address:.18.216.239.211 | |
Description* 2. This agent opens a mail log, logs an action for each document in the current database, and sends the log to the current user when the log closes. | Type* Java | Categories* (Misc) |
Implementation: | Required Client: | Server: |
Limitations: | Comments: |
public class log2agent extends AgentBase
{
public void NotesMain()
{
try
{
Session s = getSession();
AgentContext ac = s.getAgentContext();
Log log = s.createLog("Cleansing Agent");
Vector v = new Vector();
v.addElement(s.getUserName());
log.openMailLog(v, "Log for cleansing agent");
Database db = ac.getCurrentDatabase();
DocumentCollection dc = db.getAllDocuments();
for (int j=0; j<dc.getCount(); j++)
{
log.logAction("Processed document " + (j+1));
}
log.close();
}
catch (Exception e)
{
e.printStackTrace();
}
}
}