Enable logging to track queries



I’m trying to debug an issue when using

User.findOrCreate() method. For some reason the query is not returning back a row though the input param value is available in the table.

Is there a way to turn on the log that prints the query being executed?


DEBUG=adonis:* in your .env should help. I don’t remember the exact name of lucid sub name. but you should see it with the wildcard and update the entry to see only lucid related debug messages


Now it is DEBUG=knex:query

You can write DEBUG=* and then pick the one you want to log. It is as simple as that!