Esempio n. 1
0
 /**
  * @param string $format                     The format of the message
  * @param string $dateFormat                 The format of the timestamp: one supported by DateTime::format
  * @param bool   $allowInlineLineBreaks      Whether to allow inline line breaks in log entries
  * @param bool   $ignoreEmptyContextAndExtra
  */
 public function __construct($format = null, $dateFormat = null, $allowInlineLineBreaks = false, $ignoreEmptyContextAndExtra = false)
 {
     $this->format = $format ?: static::SIMPLE_FORMAT;
     $this->allowInlineLineBreaks = $allowInlineLineBreaks;
     $this->ignoreEmptyContextAndExtra = $ignoreEmptyContextAndExtra;
     parent::__construct($dateFormat);
 }
Esempio n. 2
0
 /**
  *
  * @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');
     $this->systemName = $systemName ?: gethostname();
     $this->applicationName = $applicationName;
     $this->extraPrefix = $extraPrefix;
     $this->contextPrefix = $contextPrefix;
 }
Esempio n. 3
0
 /**
  * @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(string $applicationName, string $systemName = null, string $extraPrefix = null, string $contextPrefix = 'ctxt_')
 {
     // logstash requires a ISO 8601 format date with optional millisecond precision.
     parent::__construct('Y-m-d\\TH:i:s.uP');
     $this->systemName = $systemName ?: gethostname();
     $this->applicationName = $applicationName;
     $this->extraPrefix = $extraPrefix;
     $this->contextPrefix = $contextPrefix;
 }
Esempio n. 4
0
 /**
  * @param string $format     The format of the message
  * @param string $dateFormat The format of the timestamp: one supported by DateTime::format
  */
 public function __construct($format = null, $dateFormat = null)
 {
     $this->format = $format ?: static::SIMPLE_FORMAT;
     parent::__construct($dateFormat);
 }