Source of file LogstashFormatter.php
Size: 0,596 Bytes - Last Modified: 2021-12-23T10:07:34+00:00
/var/www/docs.ssmods.com/process/src/code/LogstashFormatter.php
1234567891011121314151617181920212223 | <?php require_once THIRDPARTY_PATH . '/Zend/Log/Formatter/Interface.php'; /** * Class LogstashFormatter * @author Christian Blank <c.blank@notthatbad.net> */ class LogstashFormatter implements Zend_Log_Formatter_Interface { /** * Formats data into a single line to be written by the writer. * * @param array $event event data with `timestamp`, `priority`, `priorityName` and `message`. * @return string formatted line to write to the log */ public function format($event) { $string = json_encode($event) . PHP_EOL; return $string; } } |