\Monolog\ProcessorWebProcessor

Injects url/method and remote IP of the current web request in all records

Summary

Methods
Properties
Constants
__construct()
__invoke()
addExtraField()
No public properties found
No constants found
No protected methods found
$serverData
$extraFields
N/A
appendExtraFields()
No private properties found
N/A

Properties

$serverData

$serverData : array<string,mixed>|\ArrayAccess<string,mixed>

Type

ArrayAccess

$extraFields

$extraFields : array<string,string>

Default fields

Array is structured as [key in record.extra => key in $serverData]

Type

array

Methods

__construct()

__construct(array<string,mixed>|\ArrayAccess<string,mixed>|null  $serverData = null, array<string,string>|string[]|null  $extraFields = null) : mixed

Parameters

array|\ArrayAccess|null $serverData

Array or object w/ ArrayAccess that provides access to the $_SERVER data

array|string[]|null $extraFields

Field names and the related key inside $serverData to be added (or just a list of field names to use the default configured $serverData mapping). If not provided it defaults to: [url, ip, http_method, server, referrer] + unique_id if present in server data

Returns

mixed —

__invoke()

__invoke(array  $record) : array

Parameters

array $record

Returns

array —

The processed record

addExtraField()

addExtraField(string  $extraName, string  $serverName) : self

Parameters

string $extraName
string $serverName

Returns

self —

appendExtraFields()

appendExtraFields(array  $extra) : array

Parameters

array $extra

Returns

array —