0

Exception logging

asked 2015-05-08 01:22:40 +0800

orthello gravatar image orthello
18 2

updated 2015-05-08 16:25:53 +0800

I found this in the documentation but the exception logging piece seems to be almost an after thought.

http://books.zkoss.org/wiki/ZK_Developer%27s_Reference/UI_Patterns/Error_Handling (http://books.zkoss.org/wiki/ZKDeveloper%27sReference/UIPatterns/ErrorHandling)

<window title="Error ${requestScope['javax.servlet.error.status_code']}"
width="400px" border="normal" mode="modal" closable="true">
    <vbox>
KillerApp encounters an error: ${requestScope['javax.servlet.error.message']}
        <hbox style="margin-left:auto; margin-right:auto">
            <button label="Continue" onClick="spaceOwner.detach()"/>
            <button label="Reload" onClick="Executions.sendRedirect(null)"/>
        </hbox>
    </vbox>

    <!-- optional: record the error for improving the app -->
    <zscript>
    org.zkoss.util.logging.Log.lookup("Fatal").error(
        requestScope.get("javax.servlet.error.exception"));
    </zscript>
</window>

Would an ExecutionCleanup class be a more desirable approach?

Also, depending on what the user is doing in your application it is important to log to different log files. For example on any particular screen, tab, window, dialog, etc you could need to log to one file while any other screen, tab, window, dialog, etc you could to log to different file. Does ZK provide and organization/plumbing for logging to different files based on the user's current activites?

A little more that you probably already know: As you all know popup windows, messageboxes, event handlers, etc can all throw exceptions and they need to be logged with the rest of my logging for that user activity. But that's not the end of my concern... ZK can throw exceptions and I need to be able to associate those to the log for that user activity as well.

delete flag offensive retag edit
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2015-05-08 01:22:40 +0800

Seen: 19 times

Last updated: May 08 '15

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More