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


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?

  • Hi @demerit. Thank you so so much!
    – safron
    Jun 11, 2020 at 17:15

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

  • cool. Thank you!
    – safron
    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.