griffolion / psr-dot-notation-processor
Allows dot notation when using curly bracket interpolation in Monolog log messages.
Requires
- php: >=7.2
- monolog/monolog: ^2 <3
Requires (Dev)
- ext-json: *
- phpunit/phpunit: ^8.5.14
This package is auto-updated.
Last update: 2024-10-22 06:34:05 UTC
README
Introduction
This package allows the use of array dot notation when using PSR-3 log message interpolation within Monolog. When using PsrLogMessageProcessor
that ships as standard with Monolog, only the first level of $record['context']
is parsed into the template. This processor allows you to access deeper levels of the context
array to enrich your log messages with meaningful data that may be buried.
Example:
$logger->info('Call time took {call_stats.transfer_time}ms.', ['call_stats' => ['transfer_time' => 587]]);
Will translate to:
Call time took 587ms.
Requirements
- Monolog 2
Installation
composer require griffolion/psr-dot-notation-processor