From 5e78992f96cd904244fbe5cdb126af7486fc31bd Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 14 Dec 2012 12:15:52 +0100 Subject: [PATCH] Make applicationName mandatory in LogstashFormatter --- src/Monolog/Formatter/LogstashFormatter.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Monolog/Formatter/LogstashFormatter.php b/src/Monolog/Formatter/LogstashFormatter.php index 7cf34bda..5092e064 100644 --- a/src/Monolog/Formatter/LogstashFormatter.php +++ b/src/Monolog/Formatter/LogstashFormatter.php @@ -41,8 +41,13 @@ class LogstashFormatter extends NormalizerFormatter */ protected $contextPrefix; - - public function __construct($systemName = null, $applicationName = null, $extraPrefix = null, $contextPrefix = 'ctxt_') + /** + * @param string $applicationName the application that sends the data, used as the "type" field of logstash + * @param string $systemName the system/machine name, used as the "source" field of logstash, defaults to the hostname of the machine + * @param string $extraPrefix prefix for extra keys inside logstash "fields" + * @param string $contextPrefix prefix for context keys inside logstash "fields", defaults to ctxt_ + */ + public function __construct($applicationName, $systemName = null, $extraPrefix = null, $contextPrefix = 'ctxt_') { //log stash requires a ISO 8601 format date parent::__construct('c');