Skip to content
Snippets Groups Projects
Commit f7b8fffc authored by joe's avatar joe Committed by lucha
Browse files

Added optional logging

parent c0e84cc0
No related branches found
No related tags found
No related merge requests found
...@@ -680,6 +680,8 @@ class hyperdb extends wpdb { ...@@ -680,6 +680,8 @@ class hyperdb extends wpdb {
$success = false; $success = false;
$this->last_connection = compact('dbhname', 'host', 'port', 'user', 'name', 'tcp', 'elapsed', 'success'); $this->last_connection = compact('dbhname', 'host', 'port', 'user', 'name', 'tcp', 'elapsed', 'success');
$this->db_connections[] = $this->last_connection; $this->db_connections[] = $this->last_connection;
/* Workaround to stop logging a/i */
if ( AI_LOG_HYPERDB == true ) {
$msg = date( "Y-m-d H:i:s" ) . " Can't select $dbhname - \n"; $msg = date( "Y-m-d H:i:s" ) . " Can't select $dbhname - \n";
$msg .= "'referrer' => '{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}',\n"; $msg .= "'referrer' => '{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}',\n";
$msg .= "'server' => {$server},\n"; $msg .= "'server' => {$server},\n";
...@@ -690,6 +692,7 @@ class hyperdb extends wpdb { ...@@ -690,6 +692,7 @@ class hyperdb extends wpdb {
$msg .= "'lagged_status' => " . ( isset( $lagged_status ) ? $lagged_status : HYPERDB_LAG_UNKNOWN ); $msg .= "'lagged_status' => " . ( isset( $lagged_status ) ? $lagged_status : HYPERDB_LAG_UNKNOWN );
$this->print_error( $msg ); $this->print_error( $msg );
}
} }
if ( ! $success || ! isset( $this->dbhs[$dbhname] ) || ! $this->is_mysql_connection( $this->dbhs[$dbhname] ) ) { if ( ! $success || ! isset( $this->dbhs[$dbhname] ) || ! $this->is_mysql_connection( $this->dbhs[$dbhname] ) ) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment