# Console log when test fails

**URL:** <https://community.postman.com/t/console-log-when-test-fails/9031>\
**Category:** Help Hub\
**Created:** [November 15, 2019, 9:26am UTC](https://community.postman.com/t/console-log-when-test-fails/9031 "2019-11-15T09:26:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![theToncheff](https://avatars.discourse-cdn.com/v4/letter/t/82dd89/32.png) [@theToncheff](https://community.postman.com/u/theToncheff)\
**Post date:** [November 15, 2019, 9:26am UTC](https://community.postman.com/t/console-log-when-test-fails/9031/1 "2019-11-15T09:26:45Z")

</div>

Hello, I’m trying to debug why something fails, the test basicly checks for a string within the body, however It is a bit frustrating navigating the console, trying to figure out which test failed out of hundreds.

So, can I incorporate somehow to have console.log(pm.response.json()) or even a simple console.log(“here”) for only when the test FAILS. if the test fails

---

<div class="post-metadata">

**Author:** ![rwas2505](https://avatars.discourse-cdn.com/v4/letter/r/bc8723/32.png) [@rwas2505](https://community.postman.com/u/rwas2505)\
**Post date:** [February 6, 2021, 2:04am UTC](https://community.postman.com/t/console-log-when-test-fails/9031/2 "2021-02-06T02:04:12Z")

</div>

Would love to know if there is an answer for this.

---

<div class="post-metadata">

**Author:** ![praveendvd](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/praveendvd/32/6796_2.png) [@praveendvd](https://community.postman.com/u/praveendvd)\
**Post date:** [February 6, 2021, 4:28pm UTC](https://community.postman.com/t/console-log-when-test-fails/9031/3 "2021-02-06T16:28:28Z")

</div>

> <https://github.com/postmanlabs/postman-app-support/issues/9245>
>
> Is your feature request related to a problem? Please describe.
> Currently exception in the script just shows the error message and doesn't...

Already raised a feature request for the same
