Skip to content
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

Error when using MonologCollector with monolog/monolog 3.2 #514

Open
mimou78 opened this issue Oct 23, 2022 · 2 comments
Open

Error when using MonologCollector with monolog/monolog 3.2 #514

mimou78 opened this issue Oct 23, 2022 · 2 comments

Comments

@mimou78
Copy link

mimou78 commented Oct 23, 2022

Hello

I have tried using the Monolog Collector with version 3.0 and up of monolog.
They changed of the "write" method, it no longer takes an array as a parameter.
I solved the problem at home with an overload but if you want I can send you a PR

See
https://github.com/Seldaek/monolog/blob/3.0.0-RC1/src/Monolog/Handler/AbstractProcessingHandler.php
abstract protected function write(LogRecord $record): void;

@mimou78
Copy link
Author

mimou78 commented Oct 23, 2022

The solution is as bellow
/** * @param LogRecord $record */ protected function write(LogRecord $record): void { $this->records[] = array( 'message' => $record->formatted, 'is_string' => true, 'label' => strtolower($record->level->getName()), 'time' => $record->datetime->format('U') ); }

@parallels999
Copy link
Contributor

Fixed on #506

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants