spring 批量管理员禁用日志
spring batch admin disable logs
我已将 spring 批处理管理与现有 spring 网络应用程序集成。我可以 trigger/control 使用批处理管理屏幕的作业并使用 Tomcat8 进行部署。一切正常,但 Spring 管理批处理日志在控制台中触发,导致 catalina.out 填充 GB。
示例日志如下:
DEBUG o.s.jdbc.core.JdbcTemplate - Executing SQL query [SELECT distinct JOB_NAME from BATCH_JOB_INSTANCE order by JOB_NAME]
DEBUG o.s.jdbc.datasource.DataSourceUtils - Fetching JDBC Connection from DataSource
DEBUG o.s.jdbc.datasource.DataSourceUtils - Returning JDBC Connection to DataSource
DEBUG o.s.jdbc.core.JdbcTemplate - Executing SQL query [SELECT distinct JOB_NAME from BATCH_JOB_INSTANCE order by JOB_NAME]
DEBUG o.s.jdbc.datasource.DataSourceUtils - Fetching JDBC Connection from DataSource
DEBUG o.s.jdbc.datasource.DataSourceUtils - Returning JDBC Connection to DataSource
DEBUG o.s.jdbc.core.JdbcTemplate - Executing prepared SQL query
DEBUG o.s.jdbc.core.JdbcTemplate - Executing prepared SQL statement [SELECT COUNT(1) from BATCH_JOB_EXECUTION E, BATCH_JOB_INSTANCE I where E.JOB_INSTANCE_ID=I.JOB_INSTANCE_ID and I.JOB_NAME=?]
我的 log4j 配置如下:
<logger name="org.springframework" additivity="false" >
<level value="WARN" />
<appender-ref ref="DailyRollingFileAppender"/>
</logger>
<logger name="org.springframework.jdbc" additivity="false" >
<level value="WARN" />
<appender-ref ref="DailyRollingFileAppender"/>
</logger>
<logger name="org.springframework.web" additivity="false" >
<level value="WARN" />
<appender-ref ref="DailyRollingFileAppender"/>
</logger>
<logger name="org.springframework.batch" additivity="false" >
<level value="WARN" />
<appender-ref ref="DailyRollingFileAppender"/>
</logger>
<logger name="org.springframework.batch.admin" additivity="false" >
<level value="WARN" />
<appender-ref ref="DailyRollingFileAppender"/>
</logger>
但是我不断地获取日志。你能建议如何 disable/increase 日志级别吗?提前致谢。
我按照以下 link 的建议创建了 logback.xml,它非常有效!!
Change Spring framework log level in simple example project?
我已将 spring 批处理管理与现有 spring 网络应用程序集成。我可以 trigger/control 使用批处理管理屏幕的作业并使用 Tomcat8 进行部署。一切正常,但 Spring 管理批处理日志在控制台中触发,导致 catalina.out 填充 GB。 示例日志如下:
DEBUG o.s.jdbc.core.JdbcTemplate - Executing SQL query [SELECT distinct JOB_NAME from BATCH_JOB_INSTANCE order by JOB_NAME]
DEBUG o.s.jdbc.datasource.DataSourceUtils - Fetching JDBC Connection from DataSource
DEBUG o.s.jdbc.datasource.DataSourceUtils - Returning JDBC Connection to DataSource
DEBUG o.s.jdbc.core.JdbcTemplate - Executing SQL query [SELECT distinct JOB_NAME from BATCH_JOB_INSTANCE order by JOB_NAME]
DEBUG o.s.jdbc.datasource.DataSourceUtils - Fetching JDBC Connection from DataSource
DEBUG o.s.jdbc.datasource.DataSourceUtils - Returning JDBC Connection to DataSource
DEBUG o.s.jdbc.core.JdbcTemplate - Executing prepared SQL query
DEBUG o.s.jdbc.core.JdbcTemplate - Executing prepared SQL statement [SELECT COUNT(1) from BATCH_JOB_EXECUTION E, BATCH_JOB_INSTANCE I where E.JOB_INSTANCE_ID=I.JOB_INSTANCE_ID and I.JOB_NAME=?]
我的 log4j 配置如下:
<logger name="org.springframework" additivity="false" >
<level value="WARN" />
<appender-ref ref="DailyRollingFileAppender"/>
</logger>
<logger name="org.springframework.jdbc" additivity="false" >
<level value="WARN" />
<appender-ref ref="DailyRollingFileAppender"/>
</logger>
<logger name="org.springframework.web" additivity="false" >
<level value="WARN" />
<appender-ref ref="DailyRollingFileAppender"/>
</logger>
<logger name="org.springframework.batch" additivity="false" >
<level value="WARN" />
<appender-ref ref="DailyRollingFileAppender"/>
</logger>
<logger name="org.springframework.batch.admin" additivity="false" >
<level value="WARN" />
<appender-ref ref="DailyRollingFileAppender"/>
</logger>
但是我不断地获取日志。你能建议如何 disable/increase 日志级别吗?提前致谢。
我按照以下 link 的建议创建了 logback.xml,它非常有效!!
Change Spring framework log level in simple example project?