Page tree
Skip to end of metadata
Go to start of metadata

In M6 the entry point was changed to be more consistent with ODA and better practice (based on improved understanding of Java). The OpenLogItem is now accessible from a utility class. Just import com.paulwithers.openLog.OpenLogUtil (similar to the utility class name, org.openntf.domino.xsp.XspOpenLogUtil, that has been in use in OpenNTF Domino API for some time). Method names are the same as previous versions.

  • OpenLogUtil.logError(Throwable): pass the Exception / Throwable from your try/catch block.
  • OpenLogUtil.logError(Session, Throwable): as above, but you can pass a different session, if required.
  • OpenLogUtil.logError(Session, Throwable, String, Level, Document): full control, but only worth using if you want to pass a different session. It calls logErrorEx, so if you are using the default session, it's advisable to just call OpenLogItem.logErrorEx().
  • OpenLogUtil.logErrorEx(Throwable, String, Level, Document): first param is an Exception / Throwable or null; second param is a String custom error message; third param is a java.util.logging.Level object - Level.SEVERE, Level.WARNING, Level.INFO, Level.CONFIG, Level.FINE, Level.FINER, or Level.FINEST; fourth param is a Document object or null.
  • OpenLogUtil.logEvent(Throwable, String, Level, Document): params as above.
  • OpenLogUtil.logEvent(Session, Throwable, String, Level, Document): params as above, plus the ability to pass a different session.

To access the OpenLogItem to control settings at a granular level, use OpenLogUtil.getOpenLogItem().

If you wish to pass a message back to the browser, you can use OpenLogUtil.getOpenLogItem().addFacesMessage(String componentName, String message). This checks xsp.openlog.displayError and also xsp.openlog.genericErrorMessage.