Closed cheald closed 4 months ago
Have you have enabled debugging inside the config/database.ts
file?
Closing since no answer from issue reporter.
I apologize, I missed the initial response to this thread.
Adding debug: true
to my Postgres config appears to have the desired effect. Thank you!
Is that documented somewhere? I didn't see it on either the database or events handling pages.
Yup, its mentioned in the Lucid Debugging docs. https://lucid.adonisjs.com/docs/debugging
Package version
20.1.0
Describe the bug
I'm new to Adonis, and am building an application with Adonis 6.2.2 and Lucid 20.1.0.
I've been trying to get query logging set up per the documentation:
However, I can't get events to emit. I dug into the source and found that QueryReporter short-circuits when it decides there's nothing registered to the
db:query
event. Commenting out this check causes logging to happen as expected.Naively, I think this is probably an issue with the emitter not reporting
hasListeners
correctly, but I'm new enough to Adonis that I don't know that I can help track it down much further. It is possible that I'm registering the event incorrectly, but if that's the case, then the documentation could use an update, too.Reproduction repo
No response