I'm developing a WordPress plugin, and have no other plugins installed.
The logging function is as simple as
function log($message){
global $wpdb;
$message = $wpdb->escape($message);
$wpdb->query("INSERT INTO {$this->db['log']} (message) VALUES ('{$message}');");
}
Since the $wpdb->query didn't do anything but@mysql_query( $query, $this->dbh ); did, I'm not sure if this question is about wordpress.
source code http://xref.yoast.com/trunk/nav.html?wp-includes/wp-db.php.source.html#l1053
Plugin workflow:
1) Gather a list of events.
2) Loop the list.
3) Process each event. The function log will be invoked here when someting important should be logged such as "file is saved in /path/".
4) Stop
The whole work flow will take about 2 minutes to finish.
The log function is invoked 75 times while running. However, no log entry is found in the database while running.
When the plugin completes execution, those log entries are inserted and can be seen from database table.
What can I do that will insert log entry to database on the fly?
Thanks in advance.
