---
title: "__log"
description: "JMeter __log function reference: syntax, parameters, and practical examples for parameterizing test plans with dynamic values."
url: https://docs.jmeter.ai/functions/log/
lastUpdated: 2026-10-01
source: docs.jmeter.ai
---

# __log

*Also documented in context in the [full Functions and Variables reference](/user-manual/functions/#__log).*

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

| Name | Required | Description |
| --- | --- | --- |
| String to be logged | Yes | A string |
| Log Level | No | `OUT`, `ERR`, `DEBUG`, `INFO` (default), `WARN` or `ERROR` |
| Throwable text | No | If non-empty, creates a Throwable to pass to the logger |
| Comment | No | If 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`”

## Related

- [Functions and Variables Guide](/topics/functions-and-variables/)
- [Regex Extractor Builder](/tools/regex-tester/)
- [Full Functions Reference](/user-manual/functions/)
- [Component Reference](/user-manual/component-reference/)
