Package com.alibaba.druid.filter.logging

Examples of com.alibaba.druid.filter.logging.LogFilter


import com.alibaba.druid.filter.logging.LogFilter;

public class LogFilterTest4 extends TestCase {

    public void test_properties() throws Exception {
        LogFilter filter = new Log4jFilter();

        Assert.assertEquals(true, filter.isConnectionLogEnabled());
        Assert.assertEquals(true, filter.isStatementLogEnabled());
        Assert.assertEquals(false, filter.isStatementExecutableSqlLogEnable());
        Assert.assertEquals(true, filter.isResultSetLogEnabled());
    }
View Full Code Here


        System.setProperty("druid.log.stmt", "false");
        System.setProperty("druid.log.rs", "false");
        System.setProperty("druid.log.stmt.executableSql", "true");

        try {
            LogFilter filter = new Log4jFilter();

            Assert.assertEquals(false, filter.isConnectionLogEnabled());
            Assert.assertEquals(false, filter.isStatementLogEnabled());
            Assert.assertEquals(true, filter.isStatementExecutableSqlLogEnable());
            Assert.assertEquals(false, filter.isResultSetLogEnabled());
           
            Properties properties = new Properties();
            properties.setProperty("druid.log.conn", "true");
            properties.setProperty("druid.log.stmt", "true");
            properties.setProperty("druid.log.rs", "true");
            properties.setProperty("druid.log.stmt.executableSql", "false");
           
            filter.configFromProperties(properties);
           
            Assert.assertEquals(true, filter.isConnectionLogEnabled());
            Assert.assertEquals(true, filter.isStatementLogEnabled());
            Assert.assertEquals(false, filter.isStatementExecutableSqlLogEnable());
            Assert.assertEquals(true, filter.isResultSetLogEnabled());
        } finally {
            System.clearProperty("druid.log.conn");
            System.clearProperty("druid.log.stmt");
            System.clearProperty("druid.log.rs");
            System.clearProperty("druid.log.stmt.executableSql");
View Full Code Here

TOP

Related Classes of com.alibaba.druid.filter.logging.LogFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.