1 56 package org.objectstyle.cayenne.access.util; 57 58 import org.apache.log4j.Level; 59 import org.objectstyle.cayenne.access.QueryLogger; 60 import org.objectstyle.cayenne.conn.ConnectionEventLoggingDelegate; 61 import org.objectstyle.cayenne.conn.DataSourceInfo; 62 63 public class ConnectionEventLogger implements ConnectionEventLoggingDelegate { 64 protected Level logLevel; 65 66 public ConnectionEventLogger(Level logLevel) { 67 this.logLevel = logLevel; 68 } 69 70 public void logConnect(String url, String userName, String password) { 71 QueryLogger.logConnect(logLevel, url, userName, password); 72 } 73 74 public void logConnectFailure(Throwable th) { 75 QueryLogger.logConnectFailure(logLevel, th); 76 } 77 78 public void logConnectSuccess() { 79 QueryLogger.logConnectSuccess(logLevel); 80 } 81 82 public void logPoolCreated(DataSourceInfo info) { 83 QueryLogger.logPoolCreated(logLevel, info); 84 } 85 86 } | Popular Tags |