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

  • SEARCH
  • Home
  • 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 8692507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:19:29+00:00 2026-06-13T00:19:29+00:00

Question is much the same as this , however I’m wanting django to log

  • 0

Question is much the same as this, however I’m wanting django to log it’s verbose request information to my logging.FileHandler – ie rather than having to look at my webservers logs. I’ve tried and failed to setup the default logger django.requests to write something other than 4xx and 5xx
request information to the handlers.

So the conclusion I’ve come to after going through the docs and fiddling with the loggers and levels is that django does not actually make a lot of log statements – so I’m looking to confirm that django does not internally log non error scenarios for requests.

  • 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-13T00:19:31+00:00Added an answer on June 13, 2026 at 12:19 am

    I can’t say I did an exhaustive search, but from what I can see at django/core/handlers/base.py of django 1.4.1, the django.request logger is indeed only used for warnings and error conditions (4xx/5xx).

    That said, it’s trivial to write middleware that will do all manner of logging for you. Something very simple to get you started could be just:

    from time import time
    from logging import getLogger
    
    class LoggingMiddleware(object):
        def __init__(self):
            # arguably poor taste to use django's logger
            self.logger = getLogger('django.request')
    
        def process_request(self, request):
            request.timer = time()
            return None
    
        def process_response(self, request, response):
            self.logger.info(
                '[%s] %s (%.1fs)',
                response.status_code,
                request.get_full_path(),
                time() - request.timer
            )
            return response
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Pretty much the same as this question. But I can't seem to get this
This is a question about web application architecture rather than coding per se, however
This old stackoverflow post is asking pretty much the same question that I have,
I had asked a question very much similar to this in the thread: https://stackoverflow.com/questions/11259474/store-the-numericals-in-char-array-into-an-integer-variable-in-vc
This question is more or less programming language agnostic. However as I'm mostly into
This question is very much related to: A) How to separate CUDA code into
My first question is this although I doubt if it is possible. However, if
This is as much a design as a technical question. I'm not sure I
Given the following table (much simplified for the purposes of this question): id perPeriod
I realize that this is similar to this question , however, I only get

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.