Spring Boot Quartz-显示SQL语句

发布于 2025-01-24 20:45:21 字数 793 浏览 6 评论 0原文

我将石英与Spring Boot和Postgres数据库一起使用,作为石英物质的持久存储。我想在石英在引擎盖下执行的控制台中看到SQL日志。我尝试了许多配置属性来启用它,但是它们都没有起作用。有人可以告诉我如何启用吗?到目前为止,我使用了以下道具:

spring:
  quartz:
    job-store-type: jdbc
    jdbc:
      initialize-schema: NEVER
    properties:
      org:
        quartz:
          jobStore:
            driverDelegateClass: org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
  jpa:
    show-sql: true
    properties:
      hibernate:
        show_sql: true
        use_sql_comments: true
        format_sql: true

logging:
  level:
    org:
      quartz: DEBUG
      hibernate:
        SQL: DEBUG
      postgres: DEBUG
      springframework:
        jdbc:
          core:
            JdbcTemplate: DEBUG
            StatementCreatorUtils: TRACE

I'm using Quartz together with Spring Boot and postgres database as a persistence storage for quartz stuff. I would like to see sql logs in a console which quartz is executing under the hood. I tried many configuration properties to enable it, but none of them worked. Can someone tell me how to enable it? I used following props so far:

spring:
  quartz:
    job-store-type: jdbc
    jdbc:
      initialize-schema: NEVER
    properties:
      org:
        quartz:
          jobStore:
            driverDelegateClass: org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
  jpa:
    show-sql: true
    properties:
      hibernate:
        show_sql: true
        use_sql_comments: true
        format_sql: true

logging:
  level:
    org:
      quartz: DEBUG
      hibernate:
        SQL: DEBUG
      postgres: DEBUG
      springframework:
        jdbc:
          core:
            JdbcTemplate: DEBUG
            StatementCreatorUtils: TRACE

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文