Certainly one of jOOQ’s hottest characteristic is the out-of-the-box debug logging expertise. jOOQ builders discover this characteristic very helpful when creating their purposes. Assuming you run a jOOQ question and configure your logger to print DEBUG log output:
When this question is executed, your log output may comprise one thing like this:
Executing question : choose "BOOK"."ID", "BOOK"."TITLE" from "BOOK" order by "BOOK"."ID" asc restrict ? offset ?
-> with bind values : choose "BOOK"."ID", "BOOK"."TITLE" from "BOOK" order by "BOOK"."ID" asc restrict 2 offset 1
Fetched end result : +----+------------+
: | ID|TITLE |
: +----+------------+
: | 2|Animal Farm |
: | 3|O Alquimista|
: +----+------------+
The question is logged as it’s executed with bind variables. Additionally it is logged with inline bind values for debugging. Moreover, the primary 5 data of its end result are logged, if any.
Now, that is actually helpful as a developer, however probably not as a lot in the event you’re in manufacturing, primarily due to the sheer quantity of log output this produces, but in addition for safety causes. You do not need to depart a path of sure delicate information in any log information, together with accidentally. The fetched result’s printed as such just by calling End result.toString() on the jOOQ End result sort, so this content material isn’t distinctive to jOOQ’s out-of-the-box debug logging, but it surely might occur anyplace you output information to.
Maybe you like to not print out the BOOK.TITLE content material. The business jOOQ distributions have you ever lined. All it’s a must to do is specify a code technology configuration like so (assuming Maven):
And any longer, every time a File or End result is exported as textual content (together with DEBUG log output) or HTML (and optionally additionally as CSV, JSON, or XML), it should print as follows:
Executing question : choose "BOOK"."ID", "BOOK"."TITLE" from "BOOK" order by "BOOK"."ID" asc restrict ? offset ?
-> with bind values : choose "BOOK"."ID", "BOOK"."TITLE" from "BOOK" order by "BOOK"."ID" asc restrict 2 offset 1
Fetched end result : +----+-----+
: | ID|TITLE|
: +----+-----+
: | 2|**** |
: | 3|**** |
: +----+-----+
For extra details about this jOOQ 3.21 characteristic, check with the guide.

