SQL query logging for debugging

I’ve been digging into strapi over the last week or so and am looking at the generated queries like this (and saving to file).

What I did was add an environment variable to my ,env

DEBUG=knex:query

Then start strapi and redirect the output (I’m using linux but the principle should be the same on other platforms).

npm run develop 2> ~/logtest.txt

This is on the current v4.3.4

Hope that’s useful.

5 Likes