|
|
|
|
@ -1,14 +1,12 @@
|
|
|
|
|
package kr.xit.core.spring.config.support;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.PostConstruct;
|
|
|
|
|
import javax.annotation.*;
|
|
|
|
|
|
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
|
import org.apache.commons.lang.*;
|
|
|
|
|
import org.springframework.context.annotation.*;
|
|
|
|
|
|
|
|
|
|
import com.p6spy.engine.spy.P6SpyOptions;
|
|
|
|
|
import com.p6spy.engine.spy.appender.MessageFormattingStrategy;
|
|
|
|
|
|
|
|
|
|
import kr.xit.core.support.utils.Checks;
|
|
|
|
|
import com.p6spy.engine.spy.*;
|
|
|
|
|
import com.p6spy.engine.spy.appender.*;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <pre>
|
|
|
|
|
@ -38,8 +36,7 @@ public class P6SpySqlMultilineFormat implements MessageFormattingStrategy {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String formatMessage(final int connectionId, final String now, final long elapsed, final String category, final String prepared, final String sql, final String url) {
|
|
|
|
|
if(Checks.isEmpty(sql)) return StringUtils.EMPTY;
|
|
|
|
|
|
|
|
|
|
return "connection " + connectionId + " | took " + elapsed + "ms | " + category + "\n" + sql +";";
|
|
|
|
|
final String sqlStatement = StringUtils.isEmpty(sql)? StringUtils.EMPTY : "\n" +sql+ ";";
|
|
|
|
|
return String.format("connection %d - [%s] | %d ms %s", connectionId, category, elapsed, sql);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|