1

Currently, I'm developing a civi extension in a Wordpress environment. I want to add some debug lines to make sure I'm receiving the intended result from variable/function.

I refer this guide it says the log files are saved in ConfigAndLog directory.but that directory is not available.

I want to know how to include debug lines in the code and from where I can view the results?

Thanks in advance!

4

At the link you referenced it says you can use Civi::log()->debug(); this section, so for example Civi::log()->debug(var_export($my_variable, true));

I'm not sure what you mean by the directory isn't available? This article says how to find it: Where are the "ConfigAndLog" and "templates_c" directories?

| improve this answer | |
  • Hi @demerit. Thank you so so much! – safron Jun 11 at 17:15
3

Re "where can I view the results" - if you want to view the log via the GUI try the log viewer extension.

| improve this answer | |
  • cool. Thank you! – safron Jun 12 at 19:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.