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!

2 Answers 2

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?

1
  • Hi @demerit. Thank you so so much!
    – safron
    Commented Jun 11, 2020 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.

1
  • cool. Thank you!
    – safron
    Commented Jun 12, 2020 at 19:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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