-
-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Logger] Allow to add processors to monolog #474
Comments
Sounds good! Thank you! |
I am willing to work on a solution for this, it would be best if I get some direction from the authors. |
I think processors could be migrated to MonologConfig like handlers. |
Hi @wodor! Could you check PR #506? We have added the ability to configure channel processors via config: // config monolog.php
<?php
declare(strict_types=1);
use Monolog\Logger;
use Monolog\Processor\PsrLogMessageProcessor;
return [
'globalLevel' => Logger::DEBUG,
'handlers' => [
'stdout' => [
[
'class' => \Monolog\Handler\SyslogHandler::class,
'options' => [
'ident' => 'app',
'facility' => LOG_USER,
]
]
],
],
'processors' => [
'stdout' => [
[
'class' => PsrLogMessageProcessor::class,
'options' => [
'dateFormat' => 'c'
]
],
],
]
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Currently LogFactory just returns one processor (
framework/src/Bridge/Monolog/src/LogFactory.php
Line 132 in cc6cb37
I guess the way is to replace it in my application, but it looks like it is not easy to do because it is embedded in MonologBootloader https://github.com/spiral/framework/blob/2.8/src/Bridge/Monolog/src/Bootloader/MonologBootloader.php
So I need to "duplicate" that code too.
Example
It would be great to be able to define processors to add in a bootloader and have the constructor of implementation of
LogsInterface
that accepts a collection of processors.The text was updated successfully, but these errors were encountered: