Skip to content

Log Collector

Captures PSR-3 log messages recorded during a request or console command — level, message, context, and source location.

Log Collector panel

What It Captures

FieldDescription
timeTimestamp when the log entry was recorded
levelPSR-3 log level (debug, info, warning, error, etc.)
messageLog message (string or stringable)
contextContextual data array passed with the log call
lineSource file and line where the log call originated

Data Schema

json
[
    {
        "time": 1711878000.123,
        "level": "info",
        "message": "User logged in",
        "context": {"userId": 42},
        "line": "/app/src/AuthService.php:87"
    }
]

Summary (shown in debug entry list):

json
{
    "logger": {
        "total": 5
    }
}

Contract

php
use AppDevPanel\Kernel\Collector\LogCollector;

$collector->collect(
    level: 'info',
    message: 'User logged in',
    context: ['userId' => 42],
    line: '/app/src/AuthService.php:87',
);

How It Works

The collector is fed by LoggerInterfaceProxyAppDevPanel\Kernel\Collector\LoggerInterfaceProxyDecorator proxy for Logger Interface. Intercepts calls and forwards data to collectors.final Kernel · class · implements LoggerInterface — a PSR-3 LoggerInterfacePsr\Log\LoggerInterfacePSR-3 Logger Interface. Describes a logger instance.PSR-3 · interface decorator. When the proxy is registered as the application's logger, every $logger->info(...), $logger->error(...), etc. call is automatically intercepted and forwarded to the collector.

No manual wiring is needed if you use an adapter (Symfony, Laravel, Yii) — the proxy is registered automatically.

Debug Panel

  • Filterable log list — search by message text or log level
  • Color-coded levels — each PSR-3 level has a distinct color badge
  • Expandable entries — click to view full context data and source location
  • Entry count — total log entries shown in sidebar badge

Released under the MIT License.