net.ttddyy.dsproxy.listener.logging.SLF4JLogLevel Java Examples
The following examples show how to use
net.ttddyy.dsproxy.listener.logging.SLF4JLogLevel.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ProxyDataSourceBuilderConfigurer.java From spring-boot-data-source-decorator with Apache License 2.0 | 5 votes |
private SLF4JLogLevel toSlf4JLogLevel(String logLevel) { if (logLevel == null) { return null; } for (SLF4JLogLevel slf4JLogLevel : SLF4JLogLevel.values()) { if (slf4JLogLevel.name().equalsIgnoreCase(logLevel)) { return slf4JLogLevel; } } throw new IllegalArgumentException("Unresolved log level " + logLevel + " for slf4j logger, " + "known levels: " + Arrays.toString(SLF4JLogLevel.values())); }
Example #2
Source File: DatasourceProxyBeanPostProcessor.java From tutorials with MIT License | 5 votes |
public ProxyDataSourceInterceptor(final DataSource dataSource) { this.dataSource = ProxyDataSourceBuilder.create(dataSource) .name("MyDS") .multiline() .logQueryBySlf4j(SLF4JLogLevel.INFO) .listener(new DataSourceQueryCountListener()) .build(); }
Example #3
Source File: DataSourceProxyBeanPostProcessor.java From POC with Apache License 2.0 | 4 votes |
ProxyDataSourceInterceptor(final DataSource dataSource) { super(); this.dataSource = ProxyDataSourceBuilder.create(dataSource).name("DATA_SOURCE_PROXY") .logQueryBySlf4j(SLF4JLogLevel.INFO).multiline().countQuery() .logSlowQueryBySlf4j(5, TimeUnit.SECONDS).build(); }