[IGN-15680]Way to audit named queries?

Using 8.1.47 vision with auditing turned onto a database datasource.

I only just noticed this - queries run via system.db.runPrepUpdate queries gets audited in full to the audit log ie the full query itself is logged which is nice for seeing exactly what happened.

The same does not happen when running UPDATE/INSERT statements via runNamedQuery in fact I don’t see anything. I would have expected either the full query or even just the namedQueryPath and the params (though the full query would be preferred in case the named query definition was changed at some point).

Don’t know if I am missing something here about enabling the auditing on NQs but I didn’t see anything on the gateway audit configure page or the named query definition designer portion.

I don't see any auditing code around named query execution in 8.1 or 8.3 :grimacing:

We should probably fix that. I'm surprised no one has mentioned it before.

1 Like

Yea same, I tried searching the forum but I didn’t find anything I was wondering if I was missing something basic. Glad to know it wasn’t me (this time).

You can use system.util.audit() to generate your own audit events. Not ideal, but might help hold you over until they resolve this.

Yea that is why I noticed this initiall. In one section I was using system.util.audit and running a runPrepUpdate and I saw my audits and SQL queries interpersed correctly. Then in this new spot I was like lets try a named query curious what the audit trail would look like and only saw my manual audits, hence this post.

1 Like