REQ-2135: update log
This commit is contained in:
parent
2ff86b4ac7
commit
ae7126a5c2
@ -31,7 +31,10 @@ class LogExecSQLInterceptor implements Interceptor {
|
||||
String sql = SQLAccessor.getSQL(invocation);
|
||||
if (StringUtils.isNotBlank(sql)) {
|
||||
sql = sql.replaceAll("[\r\n]", " ");
|
||||
log.info("\n{}", SQLUtils.formatMySql(sql));
|
||||
if (props.isFormatSQL())
|
||||
log.info("\n{}", SQLUtils.formatMySql(sql));
|
||||
else
|
||||
log.info("{}", sql);
|
||||
}
|
||||
}
|
||||
return proceed;
|
||||
|
||||
@ -15,6 +15,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
@ConfigurationProperties(prefix = "mybatis-plus.configuration")
|
||||
public class MyBatisProperties {
|
||||
private boolean logExecSQL;
|
||||
private boolean formatSQL;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user