-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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.)
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
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.
Asked: 2021-05-07 18:04:36 +0800
Seen: 23 times
Last updated: Jul 17