### Eclipse Workspace Patch 1.0
#P wordpress-trunk bare
Index: wp-includes/wp-db.php
===================================================================
--- wp-includes/wp-db.php	(revision 17218)
+++ wp-includes/wp-db.php	(working copy)
@@ -934,8 +934,13 @@
 		if ( function_exists( 'error_log' )
 			&& ( $log_file = @ini_get( 'error_log' ) )
 			&& ( 'syslog' == $log_file || @is_writable( $log_file ) )
-			)
-			@error_log( $error_str );
+			) {
+			$len = (int) ini_get( 'log_errors_max_len' );
+			if ( !$len ) { 
+				$len = strlen( $error_str );
+			}
+			@error_log( substr( $error_str, 0, $len ) );
+		}
 
 		// Are we showing errors?
 		if ( ! $this->show_errors )
@@ -944,8 +949,13 @@
 		// If there is an error then take note of it
 		if ( is_multisite() ) {
 			$msg = "WordPress database error: [$str]\n{$this->last_query}\n";
-			if ( defined( 'ERRORLOGFILE' ) )
-				error_log( $msg, 3, ERRORLOGFILE );
+			if ( defined( 'ERRORLOGFILE' ) ) {
+				$len = (int) ini_get( 'log_errors_max_len' );
+				if ( !$len ) { 
+					$len = strlen( $msg );
+				}
+				error_log( substr( $msg, 0, $len ), 3, ERRORLOGFILE );
+			}
 			if ( defined( 'DIEONDBERROR' ) )
 				wp_die( $msg );
 		} else {
