[wp-hackers] yes, hide_errors but now log_errors too; if so, where?

Martin at Cleaver.org Martin at Cleaver.org
Sun Feb 11 16:52:40 GMT 2007


In http://svns.automattic.com/wordpress/trunk/wp-includes/wp-db.php (and the
wpmu equivalent)

There exists:

> 	function print_error($str = '') {
> 		global $EZSQL_ERROR;
> 		if (!$str) $str = mysql_error($this->dbh);
> 		$EZSQL_ERROR[] =
> 		array ('query' => $this->last_query, 'error_str' => $str);
>
> 		$str = htmlspecialchars($str, ENT_QUOTES);
> 		$query = htmlspecialchars($this->last_query, ENT_QUOTES);
> 		// Is error output turned on or not..
> 		if ( $this->show_errors ) {
> 			// If there is an error then take note of it
> 			print "<div id='error'>
> 			<p class='wpdberror'><strong>WordPress database error:</strong> [$str]<br />
> 			<code>$query</code></p>
> 			</div>";
> 		} else {
>
>                     // AT HERE  I'm proposing adding logging to record muted error messages
>
>                                                 return false;
>
		}
> 	}
>
>
As administrator, I'm concerned some of those errors might be symptomatic of
a deep problem.

Has anyone considered logging these hidden messages?

Thanks,I think I need to do so, as something is amiss on my server, so
what's the best logging mechanism to use? syslog? log to database? Is there
a particular php / wordpress error logging class to use?

Thanks,
       Martin
-- 
Martin at Cleaver.org


More information about the wp-hackers mailing list