-
-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dev/core#2032 Add potential to vary query log files per process #18471
Conversation
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 ```
(Standard links)
|
@eileenmcnaughton That seems pretty clever minimalism. For the CLI case, it seems workable - and I can't see any real problems. (If It should be explained more wherever there's documentation for The only question I have is how much we care about the web-based case -- e.g. if you're sending requests via web-browser and want to separate the SQL logs. In that case, it might make more sense to name files based on (a) session-id or (b) So I'd put it this way:
|
@totten I have no current use case for via web but it seems conceivable - we could just add it like
at some later point if it arises. |
Note there is more information in https://lab.civicrm.org/extensions/systemtools/-/blob/master/README.md As a follow up I could provide a link to that if wanted
@totten I added a docs PR here civicrm/civicrm-dev-docs#853 - the civicrm.settings.php.template doesn't have any existing info about this define but dev-docs does so it seemed a better place |
* Adds information about the change in civicrm/civicrm-core#18471 Note there is more information in https://lab.civicrm.org/extensions/systemtools/-/blob/master/README.md As a follow up I could provide a link to that if wanted * Update docs/tools/debugging.md Co-authored-by: Mikey O'Toole <[email protected]> Co-authored-by: Mikey O'Toole <[email protected]>
docs pr is merged |
@totten OK to merge now? |
Yup, let's merge based on the previous testing. |
Same as civicrm/civicrm-core#18471 but for the other affected place
Also requires civicrm/civicrm-packages#309 |
Overview
Creates option to redirect sql logging output to a new file
Before
All logging of sql queries goes to the same file, subject to log rotation
After
If a truthy value other than the reserved string 'backtrace' is used it will impact the eventual file name of the log.
e.g
env CIVICRM_DEBUG_LOG_QUERY=test_2 drush mycommand
Which would result in the created log file having a name like
Technical Details
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
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
Comments
https://lab.civicrm.org/dev/core/-/issues/2032
@totten what is your opinion on this approach? We could add another define & I feel like I could make a case either way