good-technologies / monolog-extras
A collection of handlers, processors, and other Monolog related classes.
v1.0.0
2023-05-17 23:25 UTC
Requires
- php: >=7.3
- monolog/monolog: ^2.9
Requires (Dev)
- friends-of-phpspec/phpspec-code-coverage: ^6.3
- infection/infection: ^0.18.2
- infection/phpspec-adapter: ^0.1.1
- marcocesarato/php-conventional-changelog: ^1.17
- phpspec/phpspec: ^7.4
- roave/security-advisories: dev-latest
README
A collection of handlers, processors, and other Monolog related classes.
Usage instructions
composer require good-technologies/monolog-extras
The add any of the classes defined below to your Monolog set up.
Processors
PersonalDetailsProcessor for redacting personal details from log data using one or more PersonalDetailsHandlerInterface instances;
Available
PersonalDetailsHandlerInterface
handlers are…Example…
<?php use GoodTechnologies\MonologExtras\Processor\PersonalDetailsProcessor;use GoodTechnologies\MonologExtras\Processor\PersonalDetailsProcessor\EmailAddressHandler;use GoodTechnologies\MonologExtras\Processor\PersonalDetailsProcessor\IpAddressHandler;use Monolog\Handler\StreamHandler;use Monolog\Logger;
$logger = new Logger();
$handler = new StreamHandler('/logs/app.log')
// Add to logger
$logger->pushProcessor($personDetailsProcessor);
// Add to specific handler
$personDetailsProcessor = new PersonalDetailsProcessor([
new EmailAddressHandler(),
new IpAddressHandler(),
]);
$handler->pushProcessor($personDetailsProcessor);
$logger->pushHandler($handler);
```
Setting up dev environment
# Load some useful aliases
. ./bin/aliases
# Build docker containers
dc build
# Install dependencies
composer install