【发布时间】:2018-04-03 13:27:32
【问题描述】:
我无法在使用 JPA 的 Spring Boot 应用程序中记录 Spring Batch 日志。这是属性文件配置(application.properties)。我想看看应用程序是否从日志中创建了 spring 批处理表。
spring.jpa.hibernate.ddl-auto=update
#show sql statement
logging.level.org.hibernate.SQL=debug
#show sql values
logging.level.org.hibernate.type.descriptor.sql=debug
log4j.category.org.springframework.jdbc.core = debug
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.show_sql=true
spring.jpa.properties.hibernate.use_sql_comments=true
spring.jpa.properties.hibernate.format_sql=true
log4j.logger.org.springframework.jdbc=DEBUG
log4j.logger.org.springframework.batch=DEBUG
这里是日志:
[2m2017-10-23 15:10:33.624[0;39m [32m INFO[0;39m [35m10092[0;39m [2m--
-[0;39m [2m[ main][0;39m
[36mo.s.jdbc.datasource.init.ScriptUtils [0;39m [2m:[0;39m Executing SQL script from class path resource [org/springframework/batch/core/schema-mysql.sql]
[2m2017-10-23 15:10:35.988[0;39m [32m INFO[0;39m [35m10092[0;39m [2m--
-[0;39m [2m[ main][0;39m
[36mo.s.jdbc.datasource.init.ScriptUtils [0;39m [2m:[0;39m Executed SQL script from class path resource [org/springframework/batch/core/schema-mysql.sql] in 2363 ms.
【问题讨论】:
-
那些日志说他们是。你还期待什么?
-
创建 SQL 日志,因为我在数据库中没有看到表
-
我相信 Spring 没有这种能力。您需要查看您的数据库日志。脚本肯定是运行的。你确定你正在寻找正确的数据库?
-
谢谢。这是 AWS mysql 中的绑定问题
标签: spring spring-batch