One of the recent editions of the
Taking Notes podcast talks a lot about
OpenLog which is written by Julian Robichaux. It sounds like a handy set of open libraries to help with code logging.
One of the neat things he's done, is made the main call able to run without any paramaters. You can just call the single main function as part in your error handling block, and the error will be logged to a database, and all the relevant info will be extracted for you. There's code for both LotusScript and Java code in there. Check it out if you're in need of some decent error logging.