#36380: SQL is formatted for logging regardless of whether it will be logged
-------------------------------------+-------------------------------------
     Reporter:  Jacob Walls          |                    Owner:  Jacob
                                     |  Walls
         Type:  Bug                  |                   Status:  assigned
    Component:  Database layer       |                  Version:  dev
  (models, ORM)                      |
     Severity:  Release blocker      |               Resolution:
     Keywords:  debug-sql            |             Triage Stage:  Accepted
  format_debug_sq                    |
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls):

 > Requiring customizing logging per project doesn't seem ideal (users
 don't want to deal with it).

 What I like about Natalia's proposal is that since we would no longer
 format SQL by default outside tests, no customization is necessary to keep
 a working query logger configuration. Users with existing (custom or
 default) logging configs will just get the pre-4.2 behavior of unformatted
 SQL in their logs (good from a performance standpoint). Users that want
 formatted SQL in their logs have an upgrade path via the example
 formatters Natalia's PR provides: copy the new default config, and change
 the `django.db.backends` logger from `ERROR` to `DEBUG`, and preserve any
 other custom handling). This way the "risk" is opt-in.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36380#comment:12>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019717076a4d-64b2087a-25d5-4add-aac5-91d5ce2a5b28-000000%40eu-central-1.amazonses.com.

Reply via email to