Hi folks,

I noticed that padding of patterns wasn't happening (e.g. %-5c). The
padding is happening to a copy of $sbuf rather than a reference.
Attached is a patch for latest LoggerPatternConverter.

Cheers,

jah
--- LoggerPatternConverter.php.orig	2010-02-12 20:54:40.796875000 +0000
+++ LoggerPatternConverter.php	2010-02-12 20:56:58.734375000 +0000
@@ -116,12 +116,12 @@
 	/**
 	 * Fast space padding method.
 	 *
-	 * @param string	$sbuf	   string buffer
+	 * @param string	&$sbuf	   string buffer
 	 * @param integer	$length	   pad length
 	 *
 	 * @todo reimplement using PHP string functions
 	 */
-	public function spacePad($sbuf, $length) {
+	public function spacePad(&$sbuf, $length) {
 		while($length >= 32) {
 		  $sbuf .= $GLOBALS['log4php.LoggerPatternConverter.spaces'][5];
 		  $length -= 32;

Reply via email to