Spring JOOQ - 从控制台中删除获取的结果

Spring JOOQ - Remove Fetched result from console

我已经完成了 link: ,但我正在从日志中查看 Fetched result。我只想保留

  1. 正在执行查询

  2. 去掉JOOQ Logo,只显示版本

错误:

2019-12-24 10:11:13.500  INFO 8944 --- [nio-8080-exec-1] org.jooq.Constants                       : 

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@  @@        @@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@        @@@@@@@@@@
@@@@@@@@@@@@@@@@  @@  @@    @@@@@@@@@@
@@@@@@@@@@  @@@@  @@  @@    @@@@@@@@@@
@@@@@@@@@@        @@        @@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@        @@        @@@@@@@@@@
@@@@@@@@@@    @@  @@  @@@@  @@@@@@@@@@
@@@@@@@@@@    @@  @@  @@@@  @@@@@@@@@@
@@@@@@@@@@        @@  @  @  @@@@@@@@@@
@@@@@@@@@@        @@        @@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@  @@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  Thank you for using jOOQ 3.12.3

2019-12-24 10:11:13.539 DEBUG 8944 --- [nio-8080-exec-1] org.jooq.tools.LoggerListener            : Executing query          : select `test`.`posts`.`ID`, `test`.`posts`.`TITLE`, `test`.`posts`.`CONTENT`, `test`.`posts`.`CREATED_ON` from `test`.`posts`
2019-12-24 10:11:13.605 DEBUG 8944 --- [nio-8080-exec-1] org.jooq.tools.LoggerListener            : Fetched result           : +----+------+--------------+---------------------+
2019-12-24 10:11:13.606 DEBUG 8944 --- [nio-8080-exec-1] org.jooq.tools.LoggerListener            :                          : |  ID|TITLE |CONTENT       |CREATED_ON           |
2019-12-24 10:11:13.606 DEBUG 8944 --- [nio-8080-exec-1] org.jooq.tools.LoggerListener            :                          : +----+------+--------------+---------------------+
2019-12-24 10:11:13.606 DEBUG 8944 --- [nio-8080-exec-1] org.jooq.tools.LoggerListener            :                          : |   1|Post 1|This is post 1|2020-01-03 00:00:00.0|
2019-12-24 10:11:13.606 DEBUG 8944 --- [nio-8080-exec-1] org.jooq.tools.LoggerListener            :                          : |   2|Post 2|This is post 2|2020-01-05 00:00:00.0|
2019-12-24 10:11:13.606 DEBUG 8944 --- [nio-8080-exec-1] org.jooq.tools.LoggerListener            :                          : |   3|Post 3|This is post 3|2020-01-07 00:00:00.0|
2019-12-24 10:11:13.606 DEBUG 8944 --- [nio-8080-exec-1] org.jooq.tools.LoggerListener            :                          : +----+------+--------------+---------------------+
2019-12-24 10:11:13.606 DEBUG 8944 --- [nio-8080-exec-1] org.jooq.tools.LoggerListener            : Fetched row(s)           : 3
2019-12-24 10:11:13.624 DEBUG 8944 --- [nio-8080-exec-1] o.s.w.s.m.m.a.HttpEntityMethodProcessor  : Using 'application/json', given [*/*] and supported [application/json, application/*+json, application/json, application/*+json]
2019-12-24 10:11:13.624 DEBUG 8944 --- [nio-8080-exec-1] o.s.w.s.m.m.a.HttpEntityMethodProcessor  : Writing [[Post [id=1, title=Post 1, content=This is post 1, createdOn=2020-01-03 00:00:00.0], Post [id=2, tit (truncated)...]
2019-12-24 10:11:13.657 DEBUG 8944 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Completed 200 OK

application.properties供参考

spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/test
spring.datasource.username=root
spring.datasource.password=root

spring.jooq.sql-dialect=MYSQL

#spring.datasource.initialization-mode=always
spring.datasource.continueOnError=true

logging.level.org.springframework.web=DEBUG
logging.level.org.jooq.*=DEBUG

关闭徽标记录

已给出从您的日志中删除徽标的答案 。有几种方法。一种是使用这个系统属性:

-Dorg.jooq.no-logo=true

中给出了 Logback 的另一个选项:

<logger name="org.jooq.Constants" level="warn">
        <appender-ref ref="STDOUT" />
</logger>

关闭结果记录

记录执行日志记录 here。您可以使用

将其关闭
Settings settings = new Settings()
    .withExecuteLogging(false);

将这些设置传递给您的 Configuration。对于后者,您还可以关闭 jOOQ 的 DEBUG 日志记录:

logging.level.org.jooq.*=INFO