My absolute favorite Lotus Agent tip of all time: Logging Agent Events
Category Programming
Adding a NotesLog routine is easy enough to use, but I still find that most developers have very little appreciation of incorporating it into their code. Now, we have two choices for painless adoption of agent logging.
This last week I was speaking with a small group of Lotus developers, and reviewing some best practices for writing agents. The Lotusphere sessions were referenced and I was surprised to learn that none of the Lotusphere ’04 sessions had a mention of using the NotesLog class (at least none that I could identify). It makes me feel old-school, but error trapping isn’t fool-proof. I’ve seen corrupt view indexes that caused an agent to completely fail and close-out before an error trap could be tripped.
Using the NotesLog class gives the developer the opportunity to do several things at once:
- Capture error codes from multiple applications and store them centrally
- Record the beginning of an agent, and its termination. If no termination occurs, then the agent failed (probably without generating any errors)
- Record the latency of an agent, to track and identify load trends or unusual server conditions.
Adding a NotesLog routine is easy enough to use, but I still find that most developers have very little appreciation of incorporating it into their code. Now, we have two choices for painless adoption of agent logging.
Julian Robichaux has recently donated his code logging application to OpenNtf.orgJohan Känngård has a LotusScript logging library that he has placed under the GPL license at SourceForge. The log4LS library is based off of jakarta log4J and even does stack traces.
- 

