/** * Constructor * @param $options */ public function __construct($options = null) { $this->options = array_merge(array('host' => 'localhost', 'port' => 24224, 'tag' => 'accesslog', 'mask' => array(), 'mask_value' => 'xxx', 'remove' => array(), 'server' => array(), 'request_key' => 'r'), is_null($options) ? array() : $options); if (isset($this->options['tag_with_date'])) { $ts = new \DateTime(); $this->options['tag'] = $this->options['tag'] . $ts->format($this->options['tag_with_date']); } $this->logger = new \Fluent\Logger\FluentLogger($this->options['host'], $this->options['port']); if (isset($this->options['error_handler'])) { $this->logger->registerErrorHandler($this->options['error_handler']); } }