Linking SLF4j to log4j2

It appears that Katalon links to SLF4j, is it possible to add log4j2 to the classpath so that I can use this logger? If so, is it as simple as copying the log4j2.jar file to the drivers file and rebooting Katalon to update the classpath? If this works, then where do I put the log4j2 configuration file or does it have to be done in Java code?

Thanks

Randy

Katalon uses Logback as the implementation of the slft4j logging API.

I am not sure if you can let Katalon to use Log4j together with Logback at the same time. I guess quite unlikely.

To use Logback, or Log4j — that is the question. The answer is Logback, unable to switch, I think.

Once I have ever tried to customize the Logback configuration. The folloing post shows what I did.

Thanks … Logback was supposed to be the next version/upgrade to log4j.

SLF4j is supposed to allow for connecting whatever logger you choose. I will try integrating log4j2 and post what I find. Thanks for the link to your project.

I am hoping that the Katalon build not linking to the latest SLF4j doesn’t have any negative affects on using log4j2.

Thanks again.

Katalon needs to allow users to use the complete capability of logback or a logger of the users choice so that we can create custom formatters, loggers and appenders. logback is very powerful but it is being neutered. I don’t want to use WebUI.comment, I want to use logging.debug, logging.info, etc so I can control what is written to where and in whatever format I want. I have extended log4j2 in my Python framework to write to a sqlite3 database so that I can create reports by querying the databse. I also log text to files and screen in different formats as well as change the log level using Windows environment variables so that I don’t have to change the code to debug or deploy in a production environment.

Katalon plase don’t hide this from more experienced developers.

Thanks :slight_smile:

1 Like