When I perform an advanced search I would like to see the query that is created based on the criteria I have chosen in the Advanced Search. Is there a way to see the query that is created?

1 Answer 1


In civicrm.settings.php, you can enable:


Then run the "Advanced Search" and look at the output in files/civicrm/ConfigAndLog/CiviCRM*log*. This will output for several queries; to avoid accumulation of junk data, you should probably disable the CIVICRM_DEBUG_LOG_QUERY after running the query.

There's some more discussion of this and other debugging techniques at http://wiki.civicrm.org/confluence/display/CRMDOC/Debugging+for+developers

  • Thank you for the information. I appreciate the assistance.
    – pmatt
    Jul 7, 2015 at 16:08

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.