0

How can I log UI events in ZK?

asked 2021-05-07 18:04:36 +0800

soldier gravatar image soldier
1

sooo i have around 100 .zul file, each file zul redirect to java class that consist onevent and button click. I'm working with a large ZK / Spring application and would like to know if I can somehow add trace style logging to all of the UI elements, but without adding log statements to each individual element. (I want to be able to trace through events that are initiated from the UI.)

delete flag offensive retag edit

3 Answers

Sort by ยป oldest newest most voted
0

answered 2021-05-08 06:24:34 +0800

Jtt gravatar image Jtt
107 4

I'm pretty sure there are some extra steps, but we've been using the following dependency and many UI events (including the data they carry) are being logged with it. That being said, they are being logged to Eclipse's console. I don't have access to the actual logs nor can be sure all the data in Eclipse's console is being saved there.

  <dependency>
        <groupId>org.zkoss.zk</groupId>
        <artifactId>zul</artifactId>
        <version>${zk.version}</version>
        <exclusions>
            <exclusion>
            <artifactId>slf4j-jdk14</artifactId>
            <groupId>org.slf4j</groupId>
            </exclusion>
        </exclusions>
  </dependency>

Further details can be found in this doc

link publish delete flag offensive edit
0

answered 2021-05-13 12:44:57 +0800

cor3000 gravatar image cor3000
6280 2 7

you can implement and configure (in your zk.xml) an ExecutionMonitor (which intercepts every UI event) https://www.zkoss.org/wiki/ZK%20Configuration%20Reference/zk.xml/The%20listener%20Element/The%20org.zkoss.zk.ui.util.ExecutionMonitor%20interface

<listener>
  <listener-class>my.package.MyExecutionMonitor</listener-class>
</listener>

From your description it sounds feasible to implement the eventStart and/or eventComplete methods of the ExecutionMonitor interface, where you can add your log statements in a single place.

link publish delete flag offensive edit
Your answer
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: 2021-05-07 18:04:36 +0800

Seen: 23 times

Last updated: Jul 17

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