I had troubles understanding the logging setup the first time, but after that, its quite simple on every project. I usually end up copy/pasting some console and db logger class and just add it to the config, I don't really think it is that difficult
El martes, 6 de septiembre de 2016, 9:57:16 (UTC-3), Ivan Sagalaev escribió: > > Hello everyone, > > It's been a while since I last posted here, please forgive if I break any > new rules inadvertently. > > I'd like to revisit a decision made in [18993][]. My use case is very > simple and obvious: I want all logging going into stdout. > > As currently implemented, I can't do it easily with a custom `LOGGING` > setting, because: > > - If I leave existing Django loggers enabled it ties me to the behavior > chosen by Django, which doesn't necessarily match what I want. For example, > Django won't log debug and info messages if `DEBUG = False`. And with > `DEBUG = True` I will be having two log messages for every log into the > 'django' logger: one from the Django's own handler, and another after it > propagates to my root logger. > > - If I disable existing Django loggers, I effectively disable all logging > from Django (and from 'py.warnings' for good measure). > > In fact, the idea of providing a default logging configuration which a > user can then *build upon* isn't really workable with Python logging: you > can either fully reuse or fully discard what's been provided, but you can't > meaningfully define a consistent configuration. Also, I have my doubts that > this "build upon" use case is based on any real demand. In my experience > there are only two approaches to configuring logging: "logging? huh, didn't > think about it" and "get your hands off my logging, I know what I'm doing!" > > The latter, incidentally, is what the old way was doing: define a sensible > default value for `LOGGING` and let users to overwrite it completely. > Currently, the default logging configuration is hard-coded in > `django.utils.log`. > > Also, I couldn't find the actual reasoning for the current behavior in the > original ticket. It starts talking about having a more useful default, not > about changing the way how this default configuration is applied. > > [18993]: https://code.djangoproject.com/ticket/18993 > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/f5b99bf1-ab67-412b-86e5-546d3a88dc2e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
