# Rules/Hooks/Custom DB Logging?

**URL:** <https://community.auth0.com/t/rules-hooks-custom-db-logging/24590>\
**Category:** Get Help\
**Tags:** logs, rules, hooks, custom-database\
**Created:** [April 29, 2019, 6:00pm UTC](https://community.auth0.com/t/rules-hooks-custom-db-logging/24590 "2019-04-29T18:00:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jholladay](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jholladay/32/11544_2.png) [@jholladay](https://community.auth0.com/u/jholladay)\
**Post date:** [April 29, 2019, 6:00pm UTC](https://community.auth0.com/t/rules-hooks-custom-db-logging/24590/1 "2019-04-29T18:00:10Z")

</div>

I’m writing custom DB scripts. There’s a lot that can go wrong before I get to the point of being able to write a log message to my database. If something like connecting to the database fails, is this logged somewhere that I can find it? If this log does not exist, do you have suggestions for dealing with life without it? If it does exist, can I explicitly write information to it?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [May 1, 2019, 11:48pm UTC](https://community.auth0.com/t/rules-hooks-custom-db-logging/24590/3 "2019-05-01T23:48:58Z")

</div>

Hi @jholladay,

The scripts run in a webtask. You can use [this extension](https://auth0.com/docs/extensions/realtime-webtask-logs) to debug with console logs, just like you would with rules. Error messages will log to the Auth0 logs which can be exported with any of the log extensions.

Let me know if this helps.

Thanks,  
Dan

---

<div class="post-metadata">

**Author:** ![jholladay](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jholladay/32/11544_2.png) [@jholladay](https://community.auth0.com/u/jholladay)\
**Post date:** [May 9, 2019, 5:57pm UTC](https://community.auth0.com/t/rules-hooks-custom-db-logging/24590/4 "2019-05-09T17:57:06Z")

</div>

Thanks, Dan. Yep, that’s just what the doctor ordered. I posted this before I started exploring extensions.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [May 9, 2019, 7:26pm UTC](https://community.auth0.com/t/rules-hooks-custom-db-logging/24590/5 "2019-05-09T19:26:32Z")

</div>

Glad you found a solution!

Good luck!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [May 24, 2019, 7:26pm UTC](https://community.auth0.com/t/rules-hooks-custom-db-logging/24590/6 "2019-05-24T19:26:37Z")

</div>

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