How to avoid excessive logging by autoreload in django rest framework?


currently I am using logging from django rest framework.But I am getting excessive logging by autoreload.

I want to avoid excessive logging of autoreload.

rn I am doing this:

‘version’: 1,
‘disable_existing_loggers’: False,
‘formatters’: {
‘file’: {
‘format’: ‘{levelname} | {asctime} | {module} | {message} | {funcName} | {lineno} |’,
‘style’: ‘{‘,
‘handlers’: {
‘fileInfo’: {
‘level’: ‘INFO’,
‘class’: ‘logging.FileHandler’,
‘filename’: "./info.log",
‘formatter’: ‘file’,
‘fileError’: {
‘level’: ‘ERROR’,
‘class’: ‘logging.FileHandler’,
‘filename’: "./error.log",
‘formatter’: ‘file’,
‘loggers’: {
‘django’: {
‘handlers’: [‘fileInfo’, ‘fileError’],
‘level’: ‘INFO’,
‘propagate’: True,


and in
import logging
logger = logging.getLogger(‘django’)

def addsomething:"print something")

Asked By: almost there



if you want to avoid excessive logging by auto reload add this line it will disable the logger

LOGGING['loggers']['django.server']['level'] = 'WARNING'

and if you want to complete disable the logging

LOGGING['loggers']['django.utils.autoreload']['level'] = 'CRITICAL'
Answered By: Tanveer Ahmad