Documentation for automated readers
A curated documentation index is available at: https://grafana.com/llms.txt
A complete documentation index is available at: https://grafana.com/llms-full.txt
These indexes can help with page discovery before fetching individual documents.
This page is also available in Markdown, which may be easier for automated readers and AI tools to parse than HTML. The Markdown version is available at https://grafana.com/docs/grafana-cloud/testing/k6/analyze-results/inspect-test-results/inspect-logs.md, or by sending Accept: text/markdown to https://grafana.com/docs/grafana-cloud/testing/k6/analyze-results/inspect-test-results/inspect-logs/. For broader documentation discovery, the curated index is available at https://grafana.com/llms.txt and the complete index is available at https://grafana.com/llms-full.txt.
Inspect logs
Logs are messages you can add to your test script to help you debug tests.
Log methods
You can use the following logging methods:
console.log()console.info()console.warn()console.error()console.debug()- Only shown when running k6 with the
-v/--verboseflag.
- Only shown when running k6 with the
To view all the logs for a test run, click the Logs tab. Depending on the method you’re using, a green, yellow, or red marking is displayed next to each log.
You can select a log message to expand it and see more details such as:
- instance_id
- level
- lz (load zone)
- source
- test_run_id
You can also filter the list by using:
- Filter: Filter by text in the log message.
- Level: Choose from the different level options.
- Info:
console.logandconsole.info. - Debug:
console.debug. - Warning:
console.warning. - Error:
console.error.
- Info:
- Load zone: Choose from the different load zones used in the test run.
Limitations
Grafana Cloud k6 has a limit of 10 messages per second for log lines. If you exceed this limit, k6 shows a warning with the number of discarded log lines.
While logs can help you debug a script or test results, they shouldn’t replace k6 API functions. It’s often an anti-pattern to use logs in the following ways:
- Track a condition status. Instead, use Checks to assert conditions.
- Track a variable value during the test execution. Instead, use the Trend metric.
You should also not rely on logging to interpret or analyze the performance of your system.
Was this page helpful?
Related resources from Grafana Labs


