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

Debugging addon

Development and Programming

Jesus's avatar
Jesus
2 posts
4 years ago
Jesus's avatar Jesus

Hi, I’m pretty new with EE and php.

I’m coding my own addon (v5) which is quite simple, it just uses the ‘after_channel_entry_insert’ hook and makes a post request.

For me now is like a black box, how can I add log traces in some methods?

Thank you

       
Andy McCormick's avatar
Andy McCormick
322 posts
about 4 years ago
Andy McCormick's avatar Andy McCormick

Welcome. If you want to write to EE’s developer log (found in the Control Panel) then you can use the Logger class. https://docs.expressionengine.com/latest/development/legacy/libraries/logger.html#developerdata-update–false-expires–0

ee()->logger->developer('Log message.');

If you want to write to the template debugger then you can use the log_item method from the Template class. https://docs.expressionengine.com/latest/development/legacy/libraries/template.html#log_itemstr-details–false

ee()->TMPL->log_item("An error has occurred");
? 1
       

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.