Locust uses Python’s built in logging framework for handling logging.
The default logging configuration that Locust applies, writes log messages directly to stderr.
--logfile can be used to change the verbosity and/or make the log go to a file instead.
The default logging configuration installs handlers for the
root logger as well as the
so using the root logger in your own test scripts will put the message into the log file if
--logfile is used:
import logging logging.info("this log message will go wherever the other locust log messages go")
It’s also possible to control the whole logging configuration in your own test scripts by using the
--skip-log-setup option. You will then have to
configure the logging yourself.
Disable Locust’s logging setup. Instead, the configuration is provided by the Locust test or Python defaults.
Choose between DEBUG/INFO/WARNING/ERROR/CRITICAL. Default is INFO. The short-hand version is
Path to log file. If not set, log will go to stdout/stderr.
Here’s a table of the loggers used within Locust (for reference when configuring logging settings manually):
The locust namespace is used for all loggers such as
This logger is used to periodically print the current stats to the console. The
stats does not go into the log file when