EventCollector
API reference › Debug › collectors › EventCollector
Captures framework events reaching the global listener during the request for the Events panel.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$captureContext | bool | Opt-in capture of selected action/view metadata; event values and rendered output are never dumped. Default: false. | EventCollector |
$module | yii\| | Debug module supplying the log target and sibling collectors, assigned by the module on registration. Default: null. | Collector |
$traceLimit | int | Opt-in argument-free trace depth; zero disables capture, and sixteen is the hard maximum. Default: 0. | EventCollector |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
capture() final | Encodes the typed snapshot built by the subclass into the payload persisted for the panel. | Collector |
id() | Returns the stable ID pairing this collector with the Events panel. | EventCollector |
instrument() | Installs low-level instrumentation as soon as the module registers the collector, before the panels are built. | Collector |
shutdown() final | Deactivates the collector once, releasing any subscription created by start(). | Collector |
startup() final | Activates the collector once at the start of the request lifecycle. | Collector |
getLogMessages() protected | Returns the accumulated log messages, optionally filtered by level, category, and exclusion lists. | Collector |
getLogTarget() protected | Returns the initialized log target of the owning debug module. | Collector |
isStarted() protected | Returns whether the collector is active for the current request. | Collector |
snapshot() protected | Returns the captured events as a typed snapshot. | EventCollector |
start() protected | Registers the wildcard event listener that records every fired event into $events. | EventCollector |
stop() protected | Detaches the wildcard listener and clears the accumulated events, so a reused worker process starts clean. | EventCollector |
Method details
Section titled “Method details”public function id(): stringReturns the stable ID pairing this collector with the Events panel.
Returns
string: Stable collector ID.
snapshot()
Section titled “snapshot() ”protected function snapshot(): PHPForge\Debug\Panel\Event\EventSnapshot|nullReturns the captured events as a typed snapshot.
Returns
PHPForge\Debug\Panel\Event\EventSnapshot|null: Captured event payload; null when the collector never started.
start()
Section titled “start() ”protected function start(): voidRegisters the wildcard event listener that records every fired event into $events.
stop()
Section titled “stop() ”protected function stop(): voidDetaches the wildcard listener and clears the accumulated events, so a reused worker process starts clean.