Giter Club home page Giter Club logo

openlogjava's Introduction

XPages OpenLog Logger

Java classes and OSGi Plugin for OpenLog from Java and SSJS. A PhaseListener automatically generates OpenLog errors / events for any SSJS errors / events.

The OSGi plugin has been incorporated into this repository since M5.

The JavaDoc is now in the Documentation folder

Note: The repository includes a non-Extension Library version. This is deprecated now. It works but is not being actively developed and fixes are not being applied. One version is because of the overhead of supporting the Extension Library version, the OSGi plugin version and the OpenNTF Domino API version. The more over-arching reason is the age of Domino 8.5.3 and my belief that developing (particularly web) applications using base XPages is unlikely to adequately compete with modern XPages or web applications. Components like the Dialog control, UI options like Bootstrap, plus performance enhancements since 8.5.3 mean a non-XPages application look and feel dated.

There are various configuration options. See the documentation.

openlogjava's People

Contributors

paulswithers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

openlogjava's Issues

Allow Using OpenLog as Mail-In Database

Added xsp.openlog.email property. If used, creates log doc in mail.box (Domino automatically handles if multiple mailboxes are in use on the server, automatically re-routing mail.box to mail1.box etc).

Add the user message in OpenLog Database's views

In class OpenLogItem, I've added the two lines :

After "rtitem.addNewLine();" :
logDoc.replaceItemValue("LogMessage", "Message, greater than 32k, is stored inside.");

Before "logDoc.replaceItemValue("LogMessage", getMessage());" :
logDoc.replaceItemValue("LogErrorMessage", errMsg + " - " + getMessage());

clipboard02

Error when invalid component id for partial refresh

Fixed in OpenNTF Domino API
try {
msg = "Unexpected error class: " + fe.getCause().getClass().getName() + "\n Message recorded is: "
+ fe.getCause().getLocalizedMessage();
} catch (Throwable ee) {
msg = fe.getLocalizedMessage();
}

Uncaught Exceptions

Some uncaught exceptions use different Java classes to those caught. The symptom is an error in OpenLogPhaseListener.

Some more Classes to Catch

Hi paul,
I've added these exceptions to the catch section to get some more errors I've found

import lotus.domino.NotesException;
import java.io.IOException;

}else if("lotus.domino.NotesException".equals(error.getClass().getName())) {
NotesException e = (NotesException) error;

        String msg = "Notes Exception:";
        msg = error.toString();
        OpenLogItem.logErrorEx(e.getCause(), msg, null, null);
    }else if("java.io.IOException".equals(error.getClass().getName())) {
        IOException e = (IOException) error;

        String msg = "Java IO:";
        msg = error.toString();
        OpenLogItem.logErrorEx(e.getCause(), msg, null, null);

processUncaughtException with lotus.domino.NotesException

It seams like the Phaselistener needs to check for more types of exceptions because I'm getting this
java.lang.ClassCastException: lotus.domino.NotesException incompatible with com.ibm.xsp.exception.EvaluationExceptionEx
at com.paulwithers.openLog.OpenLogPhaseListener.processUncaughtException(OpenLogPhaseListener.java:214)
at com.paulwithers.openLog.OpenLogPhaseListener.afterPhase(OpenLogPhaseListener.java:83)

Also seen the same type of error but something with Serializable

java.lang.ClassCastException: java.io.NotSerializableException incompatible with com.ibm.xsp.exception.EvaluationExceptionEx

Check and capture component for Java errors

Use param.get("$$xspsubmitid") to get eventHandler triggering the process that causes the error. Use getParent() from eventHandler to get component triggering the process.

Need to handle if the component does not have id.

Maybe have a separate method that, if there's an error, just returns a blank string??

ParseException not captured

I'm having some difficulties with the OpenLog, it looks like an exception could not be caught…

see screenshot & stack trace:

Stack Trace
java.lang.ClassCastException: com.ibm.jscript.parser.ParseException incompatible with com.ibm.jscript.InterpretException
at com.paulwithers.openLog.OpenLogPhaseListener.processUncaughtException(OpenLogPhaseListener.java:181)
at com.paulwithers.openLog.OpenLogPhaseListener.afterPhase(OpenLogPhaseListener.java:89)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:218)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:120)
at com.ibm.xsp.controller.FacesControllerImpl.render(FacesControllerImpl.java:270)
at com.ibm.xsp.webapp.FacesServlet.renderFacesPage(FacesServlet.java:606)
at com.ibm.xsp.webapp.FacesServlet.renderErrorPage(FacesServlet.java:501)
at com.ibm.xsp.webapp.FacesServlet.service(FacesServlet.java:183)
at com.ibm.xsp.webapp.FacesServletEx.service(FacesServletEx.java:138)
at com.ibm.xsp.webapp.DesignerFacesServlet.service(DesignerFacesServlet.java:103)
at com.ibm.designer.runtime.domino.adapter.ComponentModule.invokeServlet(ComponentModule.java:576)
at com.ibm.domino.xsp.module.nsf.NSFComponentModule.invokeServlet(NSFComponentModule.java:1335)
at com.ibm.designer.runtime.domino.adapter.ComponentModule$AdapterInvoker.invokeServlet(ComponentModule.java:853)
at com.ibm.designer.runtime.domino.adapter.ComponentModule$ServletInvoker.doService(ComponentModule.java:796)
at com.ibm.designer.runtime.domino.adapter.ComponentModule.doService(ComponentModule.java:565)
at com.ibm.domino.xsp.module.nsf.NSFComponentModule.doService(NSFComponentModule.java:1319)
at com.ibm.domino.xsp.module.nsf.NSFService.doServiceInternal(NSFService.java:662)
at com.ibm.domino.xsp.module.nsf.NSFService.doService(NSFService.java:482)
at com.ibm.designer.runtime.domino.adapter.LCDEnvironment.doService(LCDEnvironment.java:357)
at com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:313)
at com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:272)

Allow XSP Properties to be computed

Can use ValueBindingUtil.isValueBindingExpression(String paramString) to check if it's a value binding.

Will this need amending to handle EL?

For OpenNTF API version, use Formula Helper, to allow users to enter an @formula

Log Archive Feature

We're using it now but, as you know, logs can get quite big. For those of us using standard server archiving it would be nice to have something that would populate the ExpireDate field. It could be based on a couple of additional xsp property values that would enable/disable archiving and set the number of days to keep in the log before archiving. Default would be disabled.

Report Full URL

Feature Request

Using the OSGi plugin (M5) implementation, I've noticed I receive only the root XPage name for any run-time errors. I would like to grab the full URL with query parameters (I know, call me greedy).

Again, if I can help test anything, please let me know.

Erroneous Reporting of Source of Error (Application/NSF)

Using the OSGi plugin (M5), I have the XSP property set to correctly point at my OpenLog NSF and things work as expected with the exception of:

my NSFs that inherit from the same design template all seem to, when they throw a run-time error, pile them all under whichever NSF first logged an item for that day.

@paulswithers, I figured we could capture this here since we talked about it on Skype previously; let me know if I can help test anything on this.

Not getting the detailed error message

For the Two Errors, Error on Load and Error on Click I just get the message..

com.ibm.xsp.exception.EvaluationExceptionEx: Error while executing JavaScript computed expression

The Error on Property and Error on Method give the detailed message though

Haveing problem with these types of errors

Seams like they are happening above the phaselistener, but I don't know where?
What class is causing it ?

Any ideas how to catch them ?

java.lang.NullPointerException
at com.qnova.core.openLog.OpenLogPhaseListener.processUncaughtException(OpenLogPhaseListener.java:187)
at com.qnova.core.openLog.OpenLogPhaseListener.afterPhase(OpenLogPhaseListener.java:83)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:218)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:120)
at com.ibm.xsp.controller.FacesControllerImpl.render(FacesControllerImpl.java:264)
at com.ibm.xsp.webapp.FacesServlet.renderFacesPage(FacesServlet.java:572)
at com.ibm.xsp.webapp.FacesServlet.renderErrorPage(FacesServlet.java:466)
at com.ibm.xsp.webapp.FacesServlet.service(FacesServlet.java:183)
at com.ibm.xsp.webapp.FacesServletEx.service(FacesServletEx.java:138)
at com.ibm.xsp.webapp.DesignerFacesServlet.service(DesignerFacesServlet.java:103)
at com.ibm.designer.runtime.domino.adapter.ComponentModule.invokeServlet(ComponentModule.java:583)
at com.ibm.domino.xsp.module.nsf.NSFComponentModule.invokeServlet(NSFComponentModule.java:1281)
at com.ibm.designer.runtime.domino.adapter.ComponentModule$AdapterInvoker.invokeServlet(ComponentModule.java:860)
at com.ibm.designer.runtime.domino.adapter.ComponentModule$ServletInvoker.doService(ComponentModule.java:803)
at com.ibm.designer.runtime.domino.adapter.ComponentModule.doService(ComponentModule.java:572)
at com.ibm.domino.xsp.module.nsf.NSFComponentModule.doService(NSFComponentModule.java:1265)
at com.ibm.domino.xsp.module.nsf.NSFService.doServiceInternal(NSFService.java:658)
at com.ibm.domino.xsp.module.nsf.NSFService.doService(NSFService.java:481)
at com.ibm.designer.runtime.domino.adapter.LCDEnvironment.doService(LCDEnvironment.java:341)
at com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:297)
at com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:272)

OpenLogPhaseListener, use instanceof

Should be able to amend code to use:

error instanceof com.ibm.xsp.exception.EvaluationExceptionEx

instead of:

"com.ibm.xsp.exception.EvaluationExceptionEx".equals(error.getClass().getName())

Error thrown if historyUrls() is empty

Thrown if error hits during beforePageLoad?? This was encountered with Controller class. The following if statement works round it (in setThisAgent(currPage), but fromPage is still outputted as blank.

if (StringUtil.isEmpty(historyUrls)) {
fromPage = ExtLibUtil.getXspContext().getUrl().toSiteRelativeString(ExtLibUtil.getXspContext());
} else {
if (currPage) {
fromPage = historyUrls[0];
} else {
if (historyUrls.length > 1) {
fromPage = historyUrls[1];
} else {
fromPage = historyUrls[0];
}
}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.