34 'url' =>
'REQUEST_URI',
35 'ip' =>
'REMOTE_ADDR',
36 'http_method' =>
'REQUEST_METHOD',
37 'server' =>
'SERVER_NAME',
38 'referrer' =>
'HTTP_REFERER',
52 throw new \UnexpectedValueException(
'$serverData must be an array or object implementing ArrayAccess.');
57 foreach (array_keys($this->extraFields) as $fieldName) {
59 unset($this->extraFields[$fieldName]);
76 if (!isset($this->serverData[
'REQUEST_URI'])) {
92 $this->extraFields[$extraName] = $serverName;
103 foreach ($this->extraFields as $extraName => $serverName) {
104 $extra[$extraName] = isset($this->serverData[$serverName]) ? $this->serverData[$serverName] : null;
107 if (isset($this->serverData[
'UNIQUE_ID'])) {
108 $extra[
'unique_id'] = $this->serverData[
'UNIQUE_ID'];
__construct($serverData=null, array $extraFields=null)
addExtraField($extraName, $serverName)
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
Injects url/method and remote IP of the current web request in all records.
appendExtraFields(array $extra)
An optional interface to allow labelling Monolog processors.