From f4eadc2cc8f69da882a9fb42d46c72e5e99479e8 Mon Sep 17 00:00:00 2001 From: DigitalSonic Date: Mon, 21 Jun 2021 11:26:58 +0800 Subject: [PATCH] add some properties for LogErrorEnabled --- .../druid/filter/logging/LogFilter.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/main/java/com/alibaba/druid/filter/logging/LogFilter.java b/src/main/java/com/alibaba/druid/filter/logging/LogFilter.java index 126f0d5396..fc9d68b001 100644 --- a/src/main/java/com/alibaba/druid/filter/logging/LogFilter.java +++ b/src/main/java/com/alibaba/druid/filter/logging/LogFilter.java @@ -122,11 +122,37 @@ public abstract class LogFilter extends FilterEventAdapter implements LogFilterM statementExecutableSqlLogEnable = false; } } + { + String prop = properties.getProperty("druid.log.conn.logError"); + if ("false".equals(prop)) { + connectionLogErrorEnabled = false; + } else if ("true".equals(prop)) { + connectionLogErrorEnabled = true; + } + } + { + String prop = properties.getProperty("druid.log.stmt.logError"); + if ("false".equals(prop)) { + statementLogErrorEnabled = false; + } else if ("true".equals(prop)) { + statementLogErrorEnabled = true; + } + } + { + String prop = properties.getProperty("druid.log.rs.logError"); + if ("false".equals(prop)) { + resultSetLogErrorEnabled = false; + } else if ("true".equals(prop)) { + resultSetLogErrorEnabled = true; + } + } } @Override public void init(DataSourceProxy dataSource) { this.dataSource = dataSource; + configFromProperties(dataSource.getConnectProperties()); + configFromProperties(System.getProperties()); } public boolean isConnectionLogErrorEnabled() {