Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In <a href="https://docs.djangoproject.com/en/dev/topics/logging/" rel="nofollow noreferrer">Django 1.3</a> this can be done rather simply with the inclusion of logging. In summary the way I do it is very similar to the docs and keep the focus of logging on my application. My settings.py file currently looks like this.</p> <pre><code># See http://docs.djangoproject.com/en/dev/topics/logging for # more details on how to customize your logging configuration. LOGGING = { 'version': 1, 'disable_existing_loggers': True, 'formatters': { 'standard': { 'format': "[%(asctime)s] %(levelname)s [%(name)s] %(message)s", 'datefmt': "%d/%b/%Y %H:%M:%S" }, }, 'handlers': { 'null': { 'level': 'DEBUG', 'class': 'django.utils.log.NullHandler', }, 'console': { 'level': 'DEBUG', 'class': 'logging.StreamHandler', 'formatter': 'standard' }, }, 'loggers': { 'django': { 'handlers': ['console'], 'propagate': True, 'level': 'INFO', }, 'django.db.backends': { 'handlers': ['console'], 'level': 'ERROR', 'propagate': False, }, 'apps': { 'handlers': ['console'], 'level': 'DEBUG', }, } } </code></pre> <p>If you are using an older version of Django you can setup logging by using filters (Yes you <a href="https://docs.djangoproject.com/en/dev/topics/logging/#topic-logging-parts-filters" rel="nofollow noreferrer">can do this in 1.3</a> too.) <a href="https://stackoverflow.com/questions/879732/logging-with-filters">This</a> SO post should provide you with what you need to get going.</p> <p><strong>Edit Update</strong></p> <p>Again following the <a href="https://docs.djangoproject.com/en/dev/topics/logging/" rel="nofollow noreferrer">documentation</a> which gives an example combined with <a href="https://stackoverflow.com/questions/879732/logging-with-filters">this</a> post should get you where you need to go.</p> <ol> <li>Add in a <code>django</code> handler and propagate it down the chain..</li> <li>Add in a <code>django.db.backends</code> which doesn't propagate but raise the noise floor to ERROR</li> </ol> <p>I don't think there is anything else?</p> <p>HTH</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload