This article is a mirror article of machine translation, please click here to jump to the original article.

View: 19321|Reply: 1

[Source] Spring Boot uses Druid with the Property: spring.datasource.filters error

[Copy link]
Posted on 1/15/2019 4:17:29 PM | | | |
I am using version 1.1.10, and I can still use it after removing log4j with the Property: spring.datasource.filters error when using it, and the new version of Druid configuration has changed

Property: spring.datasource.filters     Value: stat,wall,log4j     Origin: class path resource [application.yml]:29:14     Reason: Unable to set value for property filters
My yml file configuration file contents

The point is this sentence:

# Configure the filters of monitoring statistics to intercept, after removing the monitoring interface sql cannot be counted, 'wall' is used for firewall, here is where the filter is modified filters: commons-log.connection-logger-name: stat,wall,log4j

Although it is configured, no error is reported, but it is useless, and the log still cannot appear on my sql monitoring page.

Correct solution:

Directly remove the log4j of value and it will work normally

You can see SQL monitoring normally, as shown in the figure below:



Reference:https://github.com/alibaba/druid/issues/2507




Previous:Spring MySQL common error solutions
Next:2019 Bachelor of Arts in English
 Landlord| Posted on 1/15/2019 4:26:40 PM |
connectionProperties: Configure some properties of the connection, config.decrypt=true here, indicating that the provided password is encrypted

filters: is an interceptor that can be configured with monitoring, logging, etc

maxActive: The maximum number of connections

initialSize: The number of initialized connections

minIdle: The number of free connections

maxWait: Get the maximum wait time for the connection

timeBetweenEvictionRunsMillis: Detects connection time, in milliseconds

minEvictableIdleTimeMillis: Detects that the connection is closed if it is greater than this value, in milliseconds

validationQuery: Verify whether the database is available through this sql statement when the system starts, for example, SELECT 'x' from dual for oracle, and SELECT 'x' for mysql.

testWhileIdle: Enables idle connection detection for recycling

testOnBorrow: When obtaining a connection from a connection pool, whether to check the connection availability will affect the performance of the connection

testOnReturn: When releasing connection to the connection pool, whether the connection availability is detected will have a slight impact on the performance

poolPreparedStatements: Enable psCache caching, set to true for oracles, and false for non-oracles

maxPoolPreparedStatementPerConnectionSize: The maximum number of caches, set to 0 for non-oracles
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com