Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best practices for logging in django project

It is always good to utilize existing patterns for solving the given problem rather then reinventing the wheel. This time it is about doing logging stuffs in django based project.

Can you please share your ideas with me and other about how do you prefer to implement logging in django based project in the following context?

  • What factors would you consider before starting design of logging system?
  • What would you like to log in a project? (messages, errors, request etc)?
  • How would you like to log?
  • What should be directory structure?
  • In what format would you like to log?
  • Which django apps do you use?
  • Have you make any such reusable apps? if yes, can you share with other?
  • Or any other idea which you find useful to share with other.

... Any little help would be really good for all django developers ...

cheers

like image 472
Software Enthusiastic Avatar asked Mar 11 '10 06:03

Software Enthusiastic


1 Answers

In Django, like in any other Python application, I'd use the standard library's logging module and call logging.debug, logging.info etc as appropriate to each message. Most of the seven questions you asked have noting to do with your Q's title -- "ask one question per question" is one key Stack Overflow mantra! Just open many questions for your many questions and let's keep this one focused on logging, OK?-)

like image 191
Alex Martelli Avatar answered Sep 28 '22 21:09

Alex Martelli