dev/core#2032 Add potential to vary query log files per process
authoreileen <emcnaughton@wikimedia.org>
Tue, 15 Sep 2020 01:16:52 +0000 (13:16 +1200)
committereileen <emcnaughton@wikimedia.org>
Tue, 15 Sep 2020 01:16:56 +0000 (13:16 +1200)
commita51ff74119e5da9bb0a8225615d45da65a9e6aa7
treed5ceee8989de67880a94d225b7126ee4bdfccdf8
parent3ed73abbc9d62870aa2422336e8fc2957857b79d
dev/core#2032 Add potential to vary query log files per process

This might be  a bit too hacky but I thought I'd put it up for consideration. Basically we have 3 existing
options for CIVICRM_DEBUG_LOG_QUERY

1) FALSE = do nothing (5.30 + or same as TRUE for earlier versions
2) backtrace = log a full backtrace
3) anything else - log the sql query

This takes a bit of leeway with the 'everything else' and includes the value a part of the
prefix for writing to the query log - allowing something like

``
env CIVICRM_DEBUG_LOG_QUERY=test_2 drush mycommand
``

Which would result in the created log file having a name like
```
CiviCRM.sql_log_test_2.7a880382d2e1d80611365ce1.log
```
CRM/Core/Error.php