Download the PHP package alexandre-daubois/monolog-processor-collection without Composer
On this page you can find all versions of the php package alexandre-daubois/monolog-processor-collection. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alexandre-daubois/monolog-processor-collection
More information about alexandre-daubois/monolog-processor-collection
Files in alexandre-daubois/monolog-processor-collection
Package monolog-processor-collection
Short Description A collection of Monolog processors
License MIT
Informations about the package monolog-processor-collection
Monolog Processor Collection
Welcome to the Monolog Processor Collection (MPC) - the ultimate suite of processors designed to enhance your logging with the renowned Monolog library. This toolkit is meticulously crafted to integrate seamlessly with PHP 8.1+, ensuring your logging captures the comprehensive details you need with minimal overhead.
MPC is engineered for developers who demand more from their logs. Whether you're tracking down elusive bugs or monitoring live production environments, processors enrich your log entries with invaluable context, turning ordinary logs into a rich, actionable dataset.
MPC is compatible with worker mode of web servers, as relevant processors implement the ResettableInterface
.
Available Processors
The package provides the following processors:
BacktraceProcessor
adds the backtrace to the log recordClientIpProcessor
adds the client IP address to the log recordEnvVarProcessor
adds the value of one or more environment variables to the log recordHighResolutionTimestampProcessor
adds the high resolution time to the log recordIsHttpsProcessor
adds a boolean value indicating whether the request is a secured HTTP request to the log recordPhpIniValueProcessor
adds the value of one or more PHP ini settings to the log recordProtocolVersionProcessor
adds the HTTP protocol version to the log recordRequestSizeProcessor
adds the size of the request to the log record, headers included, in bytesResourceUsagesProcessor
adds the resource usage to the log record as returned by getrusage()SapiNameProcessor
adds the name of the SAPI to the log recordSessionIdProcessor
adds the session ID to the log record, or null if no session is activeUuidProcessor
adds a UUID v7 to the log record to track records triggered during the same request
Installation
The recommended way to install MPC is through Composer:
Usage
All processor can be used in the same way as any other Monolog processor. For example:
Some processors, like EnvVarProcessor
and PhpIniValueProcessor
, require you to specify more
arguments. For example:
Integration with Symfony and MonologBundle
You can register those processors to be used with Symfony and MonologBundle by adding the following configuration to
your config/packages/monolog.php
file:
If you don't use autoconfigure, you need to tag the processors with monolog.processor
:
You can achieve the same configuration with YAML:
Or XML: