Hello, I’d like to request the ability to nest “log groups”. In my case, it’d be useful to have very granular sections, maybe even one for each test, and only expand the test output which fails. This way, more information could be included in each test’s logs (for example, a collapsed group with extra logs) without making it harder to look through the logs at glance.
The syntax could look like --- ---, or something along those lines. For example:
--- Starting tests < normal log section
Log some stuff
--- --- Test 1 < nested log section
a lot more logs
error detected!
^^^ ^^^ +++ < expand current subsection, which expands parents.
--- --- Test 2
logs for test 2
--- --- --- Nested closed section
some info that could stay closed
+++ +++ +++ A nested nested section.
Stuff here -- the nested expansion expands parents without expanding siblings.
--- --- Test 3
More stuff
--- Tests over, do something else
This would be a super useful (and powerful) way to make logs easier to work with in BuildKite.
Hi @noahtallen, thank you for the feedback. You are correct, as of today, Buildkite’s built-in log grouping features do not support true nested collapsible sections. While you can create multiple “groups” in a log by using the —, +++, and ^^^ markers, Buildkite only displays them at a single level. In other words, each “section” can be collapsed or expanded, but you cannot have sub-sections (and sub-sub-sections, etc.) which automatically expand their parents.
With that said see below are some potential workarounds.
What is currently supported:
Buildkite supports “collapsible” log output using certain markers in the stdout of each job:
• — Some Title
Creates a collapsible section collapsed by default.
• +++ Some Title
Creates a collapsible section expanded by default.
• ^^^ Some Title
Ends the previous section. (If you’re seeing older references, there’s a bit of variation in how these markers get used, but typically ^^^ is the “close” marker.)
This only provides one top-level layer. For example:
echo “— Starting tests”
echo “Line 1 of logs”
echo “Line 2 of logs”
echo “^^^ End tests”
Even if you emit more markers inside of that section, Buildkite won’t treat them as nested sections. They all end up as siblings in the top-level grouping.
Possible workarounds:
Multiple pipeline steps
If your ultimate goal is to separate out logs for each test or test group, you could dynamically generate multiple pipeline steps—one per test or suite. That way, each step’s logs can be treated as an isolated “block” in the Buildkite UI. It’s not truly “nested,” but it does separate log data.
Artifacts for additional logs
If you have extensive logs per test, consider capturing them as artifacts. Your main logs can display only essential, high-level details, and then if a test fails, you can navigate to the uploaded artifact for deeper logs. That keeps the main build logs from getting unwieldy.
Use test analytics (Buildkite Test Analytics)
If your real desire is to see a pass/fail summary with detailed logs only on failures, you might benefit from Buildkite’s Test Analytics feature. It’s not the same as nested logs, but it’s designed to help you quickly see which tests failed, with a direct link to the relevant output.
Inline grouping patterns
Some teams manually implement a pseudo-nesting approach with headings or indentation in the logs (e.g., ##, ### lines). It does not give you collapsible sections, but it can provide a visual structure for scanning logs.
Below are the key links:
Buildkite: Managing Log Output
Covers the official docs on how to collapse logs using —, +++, and ^^^.
Buildkite Test Analytics
Outlines how to integrate Buildkite’s Test Analytics for better test reporting, including per-test visibility.