# Is there any way to make dbt run printout the commands executing in the on-run-end hook?

**URL:** <https://discourse.getdbt.com/t/is-there-any-way-to-make-dbt-run-printout-the-commands-executing-in-the-on-run-end-hook/8434>\
**Category:** Help\
**Created:** [May 25, 2023, 1:06pm UTC](https://discourse.getdbt.com/t/is-there-any-way-to-make-dbt-run-printout-the-commands-executing-in-the-on-run-end-hook/8434 "2023-05-25T13:06:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ecerulm](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/ecerulm/32/743_2.png) [@ecerulm](https://discourse.getdbt.com/u/ecerulm)\
**Post date:** [May 25, 2023, 1:06pm UTC](https://discourse.getdbt.com/t/is-there-any-way-to-make-dbt-run-printout-the-commands-executing-in-the-on-run-end-hook/8434/1 "2023-05-25T13:06:20Z")

</div>

## The problem I’m having

When I run `dbt run` I see

```auto
12:48:40 Running 4 on-run-end hooks
12:48:40 1 of 4 START hook: xxx.on-run-end.0 ........................ [RUN]
12:48:41 1 of 4 OK hook: xxx.on-run-end.0 ........................... [SUCCESS 1 in 1.02s]
12:48:41 2 of 4 START hook: xxx.on-run-end.1 ........................ [RUN]
12:48:41 2 of 4 OK hook: xxx.on-run-end.1 ........................... [SUCCESS 1 in 0.14s]
12:48:41 3 of 4 START hook: xxx.on-run-end.2 ........................ [RUN]
12:48:41 3 of 4 OK hook: xxx.on-run-end.2 ........................... [SUCCESS 1 in 0.13s]
12:48:41 4 of 4 START hook: xxx.on-run-end.3 ........................ [RUN]
12:48:41 4 of 4 OK hook: xxx.on-run-end.3 ........................... [SUCCESS 1 in 0.14s]
12:48:41  

```

I would like to see the actual commands in there without having to look at the `./target/compiled/b2b_micro_feature_store/dbt_project.yml/hooks/xxx-on-run-end-*.sql` files

## The context of why I’m trying to do this

## What I’ve already tried

```auto
for f in ./target/compiled/b2b_micro_feature_store/dbt_project.yml/hooks/*-on-run-end-*.sql; do cat ${f}; echo ; done
drop table if exists xxx.xxx.yyy;
...
drop table if exists aaa.bbb.ccc;

```

works but it a bit cumbersome (due to the fact the the files lack trailing newlines) and the path is a bit long.

---

<div class="post-metadata">

**Author:** ![Surya](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/surya/32/3763_2.png) [@Surya](https://discourse.getdbt.com/u/Surya)\
**Post date:** [May 30, 2023, 5:03am UTC](https://discourse.getdbt.com/t/is-there-any-way-to-make-dbt-run-printout-the-commands-executing-in-the-on-run-end-hook/8434/2 "2023-05-30T05:03:00Z")

</div>

@ecerulm  
you can see the commands in the db.log file

---

<div class="post-metadata">

**Author:** ![joellabes](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/joellabes/32/3980_2.png) [@joellabes](https://discourse.getdbt.com/u/joellabes)\
**Post date:** [June 1, 2023, 4:33am UTC](https://discourse.getdbt.com/t/is-there-any-way-to-make-dbt-run-printout-the-commands-executing-in-the-on-run-end-hook/8434/3 "2023-06-01T04:33:44Z")

</div>

I have just had a quick poke around and don’t think that it’s directly overridable, but if you’re calling a macro you could always have the macro log information about itself in its definition?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/getdbt/original/1X/a7a7ca1fe379aaf90952b0e13118a817babcd14f.png) [@system](https://discourse.getdbt.com/u/system)\
**Post date:** [June 20, 2023, 2:02pm UTC](https://discourse.getdbt.com/t/is-there-any-way-to-make-dbt-run-printout-the-commands-executing-in-the-on-run-end-hook/8434/4 "2023-06-20T14:02:53Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
