Wonolog icon indicating copy to clipboard operation
Wonolog copied to clipboard

[Bug]: undefined method bootstrap()

Open tserofcj opened this issue 1 year ago • 1 comments

Description of the bug

hello, i updated my composer dependencies to be able to use php 8.1. I went with monolog/monolog 2.* and inpsyde/wonolog 2.0.0-beta.2 But now in my mu-plugin the Inpsyde\Wonolog\bootstrap(); is undefined and i have a PHP error. If i remove the bootstrap() i have no error, but also no logs. i tried to call the makeLogger() method but no success. What should we do with this new version? Thanks for your help

Reproduction instructions

update your composer.json with

"inpsyde/wonolog": "2.0.0-beta.2",
"monolog/monolog": "^2.9.2"

do a composer update in a mu-plugin, instantiate wonolog and create a log :

Inpsyde\Wonolog\bootstrap();
do_action( 'wonolog.log', 'test');

Expected behavior

we should have a folder wonolog/2024/02/08.log with our log

Environment info

PHP 8.1 wonolog 2.0.0-beta.2 monolog 2.9.2

Relevant log output

No response

Additional context

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

tserofcj avatar Feb 08 '24 14:02 tserofcj

Hello @tserofcj,

this is expected with version 2 as there is no bootstrap method any more. See the docs: https://github.com/inpsyde/Wonolog/blob/2.x/docs/02-bootstrap-and-configuration-gateway.md#the-setup-hook

chesio avatar Feb 12 '24 20:02 chesio