Search in sources :

Example 1 with Log

use of org.apache.ibatis.logging.Log in project pinpoint by naver.

the class BindingLogPlugin32 method bindingLog.

private void bindingLog(Invocation invocation) throws SQLException {
    Object[] args = invocation.getArgs();
    MappedStatement ms = (MappedStatement) args[0];
    Object parameterObject = args[1];
    StatementType statementType = ms.getStatementType();
    if (StatementType.PREPARED == statementType || StatementType.CALLABLE == statementType) {
        Log statementLog = ms.getStatementLog();
        if (isDebugEnable(statementLog)) {
            BoundSql boundSql = ms.getBoundSql(parameterObject);
            String sql = boundSql.getSql();
            List<String> parameterList = getParameters(ms, parameterObject, boundSql);
            debug(statementLog, "==> BindingLog: " + bindLogFormatter.format(sql, parameterList));
        }
    }
}
Also used : Log(org.apache.ibatis.logging.Log) BoundSql(org.apache.ibatis.mapping.BoundSql) StatementType(org.apache.ibatis.mapping.StatementType) MappedStatement(org.apache.ibatis.mapping.MappedStatement)

Aggregations

Log (org.apache.ibatis.logging.Log)1 BoundSql (org.apache.ibatis.mapping.BoundSql)1 MappedStatement (org.apache.ibatis.mapping.MappedStatement)1 StatementType (org.apache.ibatis.mapping.StatementType)1