Failed to bind properties under'spring.datasource' to javax.sql.DataSource:

Failed to bind properties under'spring.datasource' to javax.sql.DataSource:

When springboot integrates druid, the data source of druid is introduced, and the relevant configuration is configured in the configuration file application.yml

    username: root
    password: 123456
    url: jdbc:mysql://
    driver-class-name: com.mysql.jdbc.Driver

    initialSize: 5
    minIdle: 5
    maxActive: 20
    maxWait: 60000
    timeBetweenEvictionRunsMillis: 60000
    minEvictableIdleTimeMillis: 300000
    validationQuery: SELECT 1 FROM DUAL
    testWhileIdle: true
    testOnBorrow: false
    testOnReturn: false
    poolPreparedStatements: true
#    filters sql 'wall' 
    filters: stat,wall,log4j
    maxPoolPreparedStatementPerConnectionSize: 20
    useGlobalDataSourceStat: true
    connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=500
      - classpath:department.sql

But an error is reported at startup:

According to the error message: check the configuration file, the line of code is filters: stat,wall,log4j

See the reason for the error: org.apache.log4j.Logger, so I guessed that log4j related dependencies were missing, and related dependencies were introduced in the pom.

<!-- -->

Start again, success!