jooq-settings.xml

88 views
Skip to first unread message

Rob Sargent

unread,
Mar 29, 2021, 3:56:25 PM3/29/21
to jOOQ User Group
Hoping to be able to stop jOOQ logging, I'm trying this 

  <executeLogging value="false"/>
</configuration>

in every place I can think of WEB-INF/classes, WEB-INF/lib, CLASSPATH, -Dorg.Jooq.setting entry but no luck yet.  I would prefer -D option to set the property directly but what would be the property name?

Lukas Eder

unread,
Mar 29, 2021, 4:22:15 PM3/29/21
to jOOQ User Group
Are you perhaps confusing the two XSDs? You seem to be looking for this one (root element "settings"):

But you used this one (root element "configuration"):

On Mon, Mar 29, 2021 at 9:56 PM Rob Sargent <robjs...@gmail.com> wrote:
I would prefer -D option to set the property directly but what would be the property name?

There is none.

Rob Sargent

unread,
Mar 30, 2021, 1:24:36 PM3/30/21
to jooq...@googlegroups.com
On 3/29/21 2:22 PM, Lukas Eder wrote:
Are you perhaps confusing the two XSDs? You seem to be looking for this one (root element "settings"):

My usage is as follows:
  public void doGet(HttpServletRequest req, HttpServletResponse resp) {
    HashMap<String, ArrayList<String>> pmap = getParameterMap(req);
    try (Connection conn = getDbConn(req, pmap) ){
      DSLContext dsl = DSL.using(conn, SQLDialect.POSTGRES);
      /* NO Further DSL configuration */
I believe tried this jooq-settings.xml
<annotation xmlns="http://www.jooq.org/xsd/jooq-runtime-3.14.0.xsd">
  <all>
    <executeLogging value="false"/>
  </all>
</annotation>
AND 
<annotation xmlns="http://www.jooq.org/xsd/jooq-runtime-3.14.0.xsd">
    <executeLogging value="false"/>
</annotation>
in WEB-INF/classes/jooq-settings.xml, WEB-INF/lib/jooq-settings.xml (since the database is called from servlets in an embedded tomcat).  And also  -Dorg.jooq.settings=<filename>, CLASSPATH for the java command line but I'm still getting jooq debug output.  Where oh where have I gone wrong?


Thanks,
rjs


But you used this one (root element "configuration"):

On Mon, Mar 29, 2021 at 9:56 PM Rob Sargent <robjs...@gmail.com> wrote:
I would prefer -D option to set the property directly but what would be the property name?

There is none.
--
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/CAB4ELO5oDYj8tGLuZOzficTqgKxf8Gz725EeHciSZQh%3DndYavQ%40mail.gmail.com.

Lukas Eder

unread,
Mar 30, 2021, 2:06:01 PM3/30/21
to jOOQ User Group
Please check the XSD.

- The root element is "settings".
- The contents are always text nodes, never attributes (for better interoperability with e.g. Maven, where applicable)

You can use any online XSD validator (e.g. https://www.liquid-technologies.com/online-xsd-validator) to validate your XML. For example, this should work:

<settings xmlns="http://www.jooq.org/xsd/jooq-runtime-3.14.0.xsd">
  <executeLogging>false</executeLogging>
</settings>

JAXB by default doesn't validate XSD but just ignores invalid content, which makes debugging a bit hard. But any XSD validator works, too.

Just to be clear, turning executeLogging off will turn off the LoggerListener. There are still many other places where jOOQ logs things. If you want to turn off *everything*, just configure your logger (slf4j, log4j, jul, etc.) accordingly.

I hope this helps,
Lukas

Rob Sargent

unread,
Mar 30, 2021, 5:21:43 PM3/30/21
to jooq...@googlegroups.com

My apologies, I just never saw that first <element> line.  (Possibly because I dislike xml.  A lot)

One-off Toggling of this sort of config is so much easier as Properties applied on the command line or driving script.  Just sayin'

Thank you for you patience.
rjs
Reply all
Reply to author
Forward
0 new messages