How to configure and use JMeter logging
We are going to look at how JMeter outputs to both the log panel in GUI mode and the log file in non-GUI mode. We will look at the properties relating to the GUI log panel and the Appenders and Loggers that determine what data is output and at what level the logs are output at.
JMeter uses log4j to provide its logging mechanism and from the log4j website:
Log4j has three main components: loggers, appenders and layouts. These three types of components work together to enable developers to log messages according to message type and level, and to control at runtime how these messages are formatted and where they are reported.
We will look at how Jmeter configures Appenders and Loggers separately but they work together to produce the logged output.
The logging level can be set in several ways:
- From the log4j2.xml file,
- From the menu,
- From the command line.
We will explore all of these during this post. Note that you can download the sample JMX here.