Refactor transaction logging to simple SLF4J use

This commit is contained in:
Robin Bygrave committed 2013-04-15 23:16:08 +12:00
1 parent b5ef07bab9
commit cbd7b5e912
60 files changed
+2976 -4529

No files matched your search

@@ -1,56 +0,0 @@
package com.avaje.ebeaninternal.server.jmx;
import com.avaje.ebean.AdminLogging;
import com.avaje.ebean.EbeanServer;
import com.avaje.ebean.LogLevel;
import com.avaje.ebean.config.ServerConfig;
import com.avaje.ebeaninternal.server.transaction.TransactionManager;
/**
* Implementation of the LogControl.
* <p>
* This is accessible via {@link EbeanServer#getAdminLogging()} or via JMX MBean.
* </p>
*/
public class MAdminLogging implements MAdminLoggingMBean, AdminLogging {
private final TransactionManager transactionManager;
private boolean debugSql;
private boolean debugLazyLoad;
/**
* Configure from serverConfig properties.
*/
public MAdminLogging(ServerConfig serverConfig, TransactionManager txManager) {
this.transactionManager = txManager;
this.debugSql = serverConfig.isDebugSql();
this.debugLazyLoad = serverConfig.isDebugLazyLoad();
}
public void setLogLevel(LogLevel logLevel){
transactionManager.setTransactionLogLevel(logLevel);
}
public LogLevel getLogLevel() {
return transactionManager.getTransactionLogLevel();
}
public boolean isDebugGeneratedSql() {
return debugSql;
}
public void setDebugGeneratedSql(boolean debugSql) {
this.debugSql = debugSql;
}
public boolean isDebugLazyLoad() {
return debugLazyLoad;
}
public void setDebugLazyLoad(boolean debugLazyLoad) {
this.debugLazyLoad = debugLazyLoad;
}
}
@@ -1,37 +0,0 @@
package com.avaje.ebeaninternal.server.jmx;
import com.avaje.ebean.LogLevel;
public interface MAdminLoggingMBean {
/**
* The current log level .
*/
public LogLevel getLogLevel();
/**
* Set the log level for native sql queries.
*/
public void setLogLevel(LogLevel logLevel);
/**
* If true Log generated sql to the console.
*/
public boolean isDebugGeneratedSql();
/**
* Set to true to Log generated sql to the console.
*/
public void setDebugGeneratedSql(boolean debugSql);
/**
* Return true if lazy loading should be debugged.
*/
public boolean isDebugLazyLoad();
/**
* Set the debugging on lazy loading.
*/
public void setDebugLazyLoad(boolean debugLazyLoad);
}