A failed scenario tells you what expectation was missed, but the cause may lie in an earlier application operation. The embedded application log pattern puts selected application log entries inside the test log, giving the team one place to follow the scenario and investigate the failure. section 19.7 section 19.0
An order rejected at the right point
A scenario checks that an order for five large pizzas is rejected. Its test log shows the authentication step alongside application entries for the login request and the customer logging in. The entries sit within the flow of the test rather than in a separate file. section 19.4
Keep that shared log useful rather than exhaustive:
- Choose a default detail level that supports everyday diagnosis without burying important events. section 19.4
- Allow a scenario tag to increase detail when investigating a flaky failure; remove the override after finding and fixing its cause. section 19.4
- Include or exclude particular application log categories when a scenario needs more focused information. section 19.4
The aim is quick error recovery during development, not maximum logging. A hierarchical test log makes the flow easier to follow; embedding relevant application entries adds clues about what happened within that flow. Application warnings and errors can also indicate a problem even when the scenario passes. section 19.7 section 19.4
