We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Logger class

How Do I?

vw000's avatar
vw000
482 posts
4 years ago
vw000's avatar vw000

Is there any new function to log messages into EE for my projects?

I found this: https://docs.expressionengine.com/latest/development/legacy/libraries/logger.html#logger-class

But this seems to be Legacy and cannot be used anymore in EE 6.

       
Yuri's avatar
Yuri
315 posts
4 years ago
Yuri's avatar Yuri

It is legacy, but not deprecated. You can continue using it.

       
vw000's avatar
vw000
482 posts
4 years ago
vw000's avatar vw000

I actually tried but get an error:

InvalidArgumentException Caught
No such property: 'logger' on ExpressionEngine\Legacy\Facade

Facade.php:128
       
Yuri's avatar
Yuri
315 posts
4 years ago
Yuri's avatar Yuri

That’s because you need to load the library first, like shown in the docs you referenced:

ee()->load->library('logger');
       
vw000's avatar
vw000
482 posts
4 years ago
vw000's avatar vw000

You are right. Not sure why I missed that. I imagined since it’s described as Legacy it was not supported anymore. As such, I did not bother to check anymore after testing out the first example and getting the error.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.