Show Table of Contents
10.4. Checking session logs
You can check the session logs in the audit log, which is a log of all events that were logged from the session. Audit log is an XML-based log file which contains a log of all the events that occurred while executing a specific ksession.
Procedure 10.2. Creating a logger
- To create a logger, use KieServices as depicted below:
KieRuntimeLogger logger = KieServices.Factory.get().getLoggers() .newThreadedFileLogger(ksession, "mylogfile", 1000); // do something with the ksession here logger.close();
- Attach the new logger to a ksession.
- Be sure to close the logger after usage.
Procedure 10.3. Using Audit View
- To use Audit View, open
- Under the category, select .
- To open a log file in Audit View, select the log file using the action in the top right corner, or simply drag and drop the log file from the Package Explorer or Navigator into the Audit View.
- A tree-based view is generated based on the data inside the audit log. Depicted below is an example tree-based view:

Figure 10.2. Tree-Based View
- An event is shown as a subnode of another event if the child event is caused by a direct consequence of the parent event.
Note
Note that the file-based logger will only save the events on close (or when a certain threshhold is reached). If you want to make sure the events are saved on a regular interval (for example during debugging), make sure to use a threaded file logger, so the audit view can be updated to show the latest state. When creating a threaded file logger, you can specify the interval after which events should be saved to the file (in milliseconds).

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.