0

I need to only add the logger which logs all the api requests coming to my server. In the documentation,

django.request

Log messages related to the handling of requests. 5XX responses are raised as ERROR messages; 4XX responses are raised as WARNING messages. Requests that are logged to the django.security logger aren’t logged to django.request.

django.server

Log messages related to the handling of requests received by the server invoked by the runserver command. HTTP 5XX responses are logged as ERROR messages, 4XX responses are logged as WARNING messages, and everything else is logged as INFO.

I tried disabling django.server but I could not see any difference in my logs. So, I thought maybe it is for requests emanating from my server. Nope. Still nothing.

So what does django.server do?

3
  • According to the docs is's the dev server, not used in production Commented Nov 9, 2021 at 8:29
  • I didn't find any such mention at all. Can you provide a link? Commented Nov 11, 2021 at 12:59
  • 1
    It's in the quote you posted. Django.server is invoked by the runserver command Commented Nov 11, 2021 at 14:07

1 Answer 1

0

I had a similar problem and got clarification from Django guys - configuration in settings.pay is only for the dev server invoked by run server command. Otherwise you need to call logger in the code. See this ticket https://code.djangoproject.com/ticket/34236#comment:4

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.