How to get Katalon's console log in Collection of Suite execution?

I guess, you would be surprised to find the execute0.log file is not a plain line-oriented text; it is an XML file like this:

$ head -n 20 Reports/20221109_170914/TS1/20221109_170915/execution0.log
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE log SYSTEM "logger.dtd">
<log>
<record>
  <date>2022-11-09T17:09:22</date>
  <millis>1667981362757</millis>
  <sequence>0</sequence>
  <level>START</level>
  <class>com.kms.katalon.core.logging.XmlKeywordLogger</class>
  <method>startSuite</method>
  <thread>1</thread>
  <message>Start Test Suite : Test Suites/TS1</message>
  <nestedLevel>0</nestedLevel>
  <escapedJava>false</escapedJava>
  <property name="rerunTestFailImmediately">false</property>
  <property name="retryCount">0</property>
  <property name="name">TS1</property>
  <property name="description"></property>
  <property name="id">Test Suites/TS1</property>
</record>

Classical shell commands (grep, sed, etc) are not enough. You need a program that parses the execution0.log to extract information you want out of it. You need to develop it for yourself.

Ths execution0.log find tends to be very large (20Kbytes, 20mb, or even larger). Therefore DOM-oriented XML parsers are not good fit for processing it. Katalon Studio uses StAX parser to process execution0.log file. See the following article about StAX programming:

1 Like