_format = $format; } /** * Factory for Zend_Log_Formatter_Simple classe * * @param array|Zend_Config $options * @return Zend_Log_Formatter_Simple */ public static function factory($options) { $format = null; if (null !== $options) { if ($options instanceof Zend_Config) { $options = $options->toArray(); } if (array_key_exists('format', $options)) { $format = $options['format']; } } return new self($format); } /** * Formats data into a single line to be written by the writer. * * @param array $event event data * @return string formatted line to write to the log */ public function format($event) { $output = $this->_format; foreach ($event as $name => $value) { if ((is_object($value) && !method_exists($value,'__toString')) || is_array($value) ) { $value = gettype($value); } $output = str_replace("%$name%", $value, $output); } return $output; } }