Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8663633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:02:12+00:00 2026-06-12T17:02:12+00:00

By reading the official django documentation I haven’t understood much about it. https://docs.djangoproject.com/en/dev/topics/logging/#configuring-logging I

  • 0

By reading the official django documentation I haven’t understood much about it.
https://docs.djangoproject.com/en/dev/topics/logging/#configuring-logging

I would like to enable logging also if DEBUG in settings.py is set to True.
I would like the errors to be logged in a file.

How to do that?

These are the default django settings for logging which I currently have now:

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'filters': {
        'require_debug_false': {
            '()': 'django.utils.log.RequireDebugFalse'
        }
    },
    'handlers': {
        'mail_admins': {
            'level': 'ERROR',
            'filters': ['require_debug_false'],
            'class': 'django.utils.log.AdminEmailHandler'
        }
    },
    'loggers': {
        'django.request': {
            'handlers': ['mail_admins'],
            'level': 'ERROR',
            'propagate': True,
        },
    }
}

PS:
I’m using Apache + mod_wsgi in my development environment because I use a development machine which i access remotely on my LAN, this means i’m not using the django development server and I can’t see the console log messages.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T17:02:13+00:00Added an answer on June 12, 2026 at 5:02 pm

    Django logging is not disabled by default in either DEBUG mode unless you have set it to.

    Add below to your handlers part of LOGGING

    'file':
            {
                'level':
                    'INFO',
                'class':
                    'logging.FileHandler',
                'formatter':
                    'verbose',
                'filename':
                    'myapp.log'
    
            }
    

    It will log to myapp.log file in your project root. You can specify a complete path.

    And add a formatters field to the Logging dict

    'formatters': {
            'verbose': {
                'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
            },
            'simple': {
                'format':
                    '%(levelname)s %(message)s'
            },
        },
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been reading the official docs about sending emails from Plone using some templates,
I was reading the official Oracle documentation about Concurrency in Java and I was
While reading the spree source code via the official code repository on Github, https://github.com/spree/spree
I have been reading a lot of django articles, including the official doc. Occasionally,
I was reading the code in the official demo page for slider: http://jqueryui.com/demos/slider/ and
Reading about the Dispose pattern , I see the documentation repeatedly refer to cleaning
I am currently developing my first Android application by reading Dev Documentation at Android
I'm a newbie and am learning the iOS-dev through reading the official tutorial Your
I am reading spring through its official documentation and at one place I came
I have been reading lots of docs, blogs,articles.. talking about Mysql Replication and i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.