I found quite useful to make proxy class OpenLog with static log methods. they instantiate OpenLogItem from session (actualy, we made SessionFactory working in different contexts: JSF, agent, CORBA).
I put openlog into package org.openntf.openlog (recommended for next release)
in SSJS one can wirte:
try {
…
} catch(e) {
org.openntf.openlog.OpenLog.logError(e)
}