I don't think there is a best practice for logging. It would heavily depend on your use cases.
Katalon Studio by default generates logs for individual test cases, and test reports (in .csv
, .html
, .log
and .xml
formats) for test suites.
As you have already said, you can integrate the logger, as discussed here and here on Katalon forums, and add it into a .properties
file:
# Root logger option
log4j.rootLogger=INFO, file
# Direct log messages to a log file
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.Append=false
log4j.appender.file.File=C:\\log\\logging.log
log4j.appender.file.MaxFileSize=10MB
log4j.appender.file.MaxBackupIndex=10
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:(%F:%L) - %m%n
and then after setting path of config file to
PropertyConfigurator.configure("path of .properties file")
And, of course, the most custom way is to create your own logging and reporting framework.