sundayhaxors / monolog-sign-logs
A Monolog Processor which signs log-entries with a private hash to prevent log manipulation
dev-master
2020-12-15 14:51 UTC
Requires
- php: ^7.2
- monolog/monolog: ^1.0.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2
- phpstan/phpstan: ^0.12
- phpunit/phpunit: ^8
- spatie/phpunit-snapshot-assertions: ^3
- vimeo/psalm: ^3.5
This package is auto-updated.
Last update: 2024-12-15 23:09:00 UTC
README
Monolog processor that will cryptographically sign all the log messages for you.
Installation
$ composer require sundayhaxors/monolog-sign-logs
Usage
<?php use Monolog\Logger; use Monolog\Handler\StreamHandler; use SundayHaxors\Monolog\SignLogs\Processor\SignLogsProcessor; $log = new Logger('logger'); $log->pushHandler(new StreamHandler('path/to/log', Logger::WARNING)); $processor = new SignLogsProcessor('YOUR-SECRET-KEY','Hashing Algorithm'); $log->pushProcessor($processor); $log->log(Logger::DEBUG, 'This is a log message');
For the available Hashing Algorithms in your PHP Installation, please check the output of the function hash_algos();
In case you use several Processors in your Stack, take care that the SignLogsProcessor is running last.
License
Package is licensed under the LGPL License - see the LICENSE file for details