This project provides code to generate OpenLog errors and events from SSJS or Java. Significant benefits of the project are:
-
The code can reside in an NSF itself or can be deployed to the server as an extension library (OSGi plugin).
-
Providing a custom error page is in use in the application, uncaught SSJS errors (i.e. errors where you don't have a try/catch block) will also be logged.
-
Flexible APIs for caught errors from SSJS.
-
Efficient logging from SSJS - all logging is done in the render response phase and if the same SSJS error / event is triggered multiple times during the JSF lifecycle, it will only be processed once.
-
Static methods for Java access, so no need to create an object before calling the code.
-
YouTube video to show how to implement it http://www.youtube.com/watch?v=mbZ8vamCNpE.
Thanks to Nathan Freeman, Tim Tripcony, Rene Winkelmeyer, Toby Samples for helping point me in the right direction on some technical difficulties.
Thanks, Nathan, for suggesting falling back to notes.ini.
Thanks, Mark Leusink, for pointing me in the direction of code in XPage Debug Toolbar project to access SSJS error line numbers etc, but fortunately I found out how to find the relevant properties from the underlying Java class, so took a different route.
Nathan is listed as a contributor because of his work on refactoring the original Java classes used for XPages Help Application that provided a starting point for this project.