At the following this Spring For example, I expected to see the result as follows:
Creating tables Inserting customer record for John Woo Inserting customer record for Jeff Dean ...
Instead, I received several DEBUG log messages interspersed between each line:
Creating tables 12:31:16.474 [main] DEBUG osjdbc.core.JdbcTemplate - Executing SQL statement [drop table customers if exists] 12:31:16.484 [main] DEBUG osjdbc.datasource.DataSourceUtils - Fetching JDBC Connection from DataSource 12:31:16.484 [main] DEBUG osjdSimpleDriverDataSource - Creating new JDBC Driver Connection to [jdbc:h2:mem] ...
These various answers seem that this can be solved by changing the log level in my log4j.properties file. However, following the Spring example , the log4j.properties file log4j.properties never mentioned.
Interestingly, Spring apparently uses log4j inside:
$ grep -R "log4j" * Binary file build/libs/gs-relational-data-access-0.1.0.jar matches
I assume that I could use log4j to fix this problem, but the manual does not seem to contain information on where log4j.properties or how to integrate it into this project.
How to change log level to delete these DEBUG statements?
If I need to use the log4j.properties file, where can I put it? Do I need to bind it to my build.gradle file or refer to it in my .java files somehow?
source share