Skip to content

__log

JMeter __log function reference: syntax, parameters, and practical examples for parameterizing test plans with dynamic values.

Difficulty
intermediate
Guide type
reference
Estimated read time
1 min read
Last verified version
Verified JMeter 5.6

Also documented in context in the full Functions and Variables reference.

The log function logs a message, and returns its input string

NameRequiredDescription
String to be loggedYesA string
Log LevelNoOUT, ERR, DEBUG, INFO (default), WARN or ERROR
Throwable textNoIf non-empty, creates a Throwable to pass to the logger
CommentNoIf present, it is displayed in the string. Useful for identifying what is being logged.

The OUT and ERR log level names are used to direct the output to System.out and System.err respectively. In this case, the output is always printed - it does not depend on the current log setting.

For example:

\$\{__log(Message)\} : written to the log file as โ€œ โ€ฆ thread Name : Messageโ€

\$\{__log(Message,OUT)\} : written to console window

\$\{__log(\$\{VAR\},,,VAR=)\} : written to log file as โ€œ โ€ฆ thread Name VAR=valueโ€

On this page