Avoid logging of DB values and only print SQL

26 views
Skip to first unread message

hnaray...@gmail.com

unread,
Jul 27, 2020, 10:39:18 AM7/27/20
to jOOQ User Group
Hi,

I would like to understand how to avoid DB values and print only the SQL. There could be sensitive information when the values are printed.
Currently my configuration prints both SQL and the DB record with values.

Thanks,
Harish.

Lukas Eder

unread,
Jul 27, 2020, 11:44:54 AM7/27/20
to jOOQ User Group
Hi Harish,

These things are printed by default on DEBUG level. You can turn off debug logging for jOOQ, or turn off logging in jOOQ in general:

Thanks,
Lukas 

--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/aaf64df0-373c-4012-b450-7e32c8ea4654o%40googlegroups.com.

hari prasad Narayanappa .A

unread,
Jul 27, 2020, 10:37:35 PM7/27/20
to jOOQ User Group
Hello Lukas,

Thank you for the quick response. As far as I understand we can either switch of completely or live with "Executing Query" and "Fetched Result & Fetched row(s)".

If we could have the switch/config between the "Executing Query" and "Fetched Result". Then we can switch off the "Fetched Result" which could lead to exposing sensitive data.
Please let me know if my understanding is correct and your views on the switch.

Regards,
Harish.

On Monday, July 27, 2020 at 9:14:54 PM UTC+5:30, Lukas Eder wrote:
Hi Harish,

These things are printed by default on DEBUG level. You can turn off debug logging for jOOQ, or turn off logging in jOOQ in general:

Thanks,
Lukas 

On Mon, Jul 27, 2020 at 4:39 PM <hnaray...@gmail.com> wrote:
Hi,

I would like to understand how to avoid DB values and print only the SQL. There could be sensitive information when the values are printed.
Currently my configuration prints both SQL and the DB record with values.

Thanks,
Harish.

--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq...@googlegroups.com.

Rob Sargent

unread,
Jul 27, 2020, 10:48:48 PM7/27/20
to jooq...@googlegroups.com
Hm, all that data did go back to the client so it’s exposed there and if non-admin can read your logs you have a different problem. But most rdbms can log the queries themselves so you should be able to turn off jooq logging

On Jul 27, 2020, at 8:37 PM, hari prasad Narayanappa .A <hnaray...@gmail.com> wrote:


To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/41c0e781-ae67-4a6d-8ff7-185afe385f0co%40googlegroups.com.

Lukas Eder

unread,
Jul 28, 2020, 3:34:41 AM7/28/20
to jOOQ User Group
The out-of-the-box logger is really a very simple ExecuteListener, which you can easily write yourself according to your own specific needs.

There had been a few requests in the past to make the out of the box functionality configurable. Some examples:

- Ability to pass specific formatting options (e.g. \n or \r\n for newlines, etc.)
- Ability to generate ? bind placeholders with bind values in comments, e.g. ? /* 1 */
- Ability to override the number of result rows logged by default
- Result formatting options (e.g. log results as CSV or JSON rather than text)

I think we almost have enough material to employ a full time employee on the configurability of this logger :)

Or, you just quickly implement your own logger listener, based on the implementation of org.jooq.tools.LoggerListener (e.g. override resultEnd(), recordEnd() with a no-op implementation) and have it exactly your way.

I hope this helps,
Lukas

To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/41c0e781-ae67-4a6d-8ff7-185afe385f0co%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages