Closed agarzon-orangerine closed 2 years ago
I'm using the core template v3
Which template exactly is that @agarzon-orangerine? Leaf MVC, Leaf API or skeleton, or you scaffolded a basic Leaf app with Leaf CLI?
using leaf cli
On Fri, Aug 26, 2022, 6:20 p.m. Michael Darko @.***> wrote:
I'm using the core template v3
Which template exactly is that @agarzon-orangerine https://github.com/agarzon-orangerine? Leaf MVC, Leaf API or skeleton, or you scaffolded a basic Leaf app with Leaf CLI?
— Reply to this email directly, view it on GitHub https://github.com/leafsphp/leaf/issues/141, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR44IKMOEIILKWBSFTOQLGLV3E7JVANCNFSM57X5X7KQ . You are receiving this because you were mentioned.Message ID: @.***>
Can you maybe leave a screenshot of your directory structure? I'll check on replicating your issue
I was able to reproduce the problem with a fresh brand new leaf project:
PHP 8.1.2 (cli) (built: Aug 15 2022 12:24:10) (NTS)
leaf create leaf-test --api --v3
cd leaf-test
leaf serve
Add this line to the router:
app()->logger()->debug('Hello!');
Same error. `Error thrown with message "Cannot use object of type Leaf\Helpers\Container as array"
Stacktrace:
leafsphp/leaf#141 Leaf\Router\Core:run in /home/agarzon/GIT/leaf-test/public/index.php:130
`
Thanks. This is very helpful
This issue has been fixed by @jeijei4. A patch release will be up soon to fix this. Thanks
Describe the bug Looks like the logger is not working, followed the instructions in the doc.
To Reproduce Just by adding this line, to test the logger :
app()->logger()->info('Hello');
Expected behavior It should create and write the log file (it is enabled and well defined in config/app.php, I'm using the core template v3), and yes "leafs/logger" is installed via composer.
Additional context The error : ` Error thrown with message "Cannot use object of type Leaf\Helpers\Container as array"
Stacktrace: leafsphp/leaf#10 Error in /app/vendor/leafs/leaf/src/App.php:168 leafsphp/leaf#9 Leaf\App:Leaf{closure} in /app/vendor/leafs/leaf/src/Helpers/Container.php:223 leafsphp/leaf#8 Leaf\Helpers\Container:Leaf\Helpers{closure} in /app/vendor/leafs/leaf/src/Helpers/Container.php:67 leafsphp/leaf#7 Leaf\Helpers\Container:get in /app/vendor/leafs/leaf/src/App.php:210 leafsphp/leaf#6 Leaf\App:__get in /app/vendor/leafs/leaf/src/App.php:292 leafsphp/leaf#5 Leaf\App:logger in /app/app/controllers/BrainController.php:25 leafsphp/leaf#4 App\Controllers\BrainController:facial in /app/vendor/leafs/router/src/Router/Core.php:489 leafsphp/leaf#3 call_user_func_array in /app/vendor/leafs/router/src/Router/Core.php:489 leafsphp/leaf#2 Leaf\Router\Core:invoke in /app/vendor/leafs/router/src/Router/Core.php:455 leafsphp/leaf#1 Leaf\Router\Core:handle in /app/vendor/leafs/router/src/Router/Core.php:386
0 Leaf\Router\Core:run in /app/public/index.php:130
`