mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
add setLogger method
This commit is contained in:
@@ -59,6 +59,13 @@ public class DruidDataSourceStatLoggerImpl extends DruidDataSourceStatLoggerAdap
|
||||
public void setLoggerName(String loggerName) {
|
||||
logger = LogFactory.getLog(loggerName);
|
||||
}
|
||||
|
||||
public void setLogger(Log logger) {
|
||||
if (logger == null) {
|
||||
throw new IllegalArgumentException("logger can not be null");
|
||||
}
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void log(DruidDataSourceStatValue statValue) {
|
||||
@@ -70,7 +77,7 @@ public class DruidDataSourceStatLoggerImpl extends DruidDataSourceStatLoggerAdap
|
||||
map.put("name", statValue.getName());
|
||||
map.put("activeCount", statValue.getActiveCount());
|
||||
|
||||
if (statValue.activePeak > 0) {
|
||||
if (statValue.getActivePeak() > 0) {
|
||||
map.put("activePeak", statValue.getActivePeak());
|
||||
map.put("activePeakTime", statValue.getActivePeakTime());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user