Am I the only one thinking about using both django-logging and the logging module from the standard library at the same time?
I find it useful to not have to dig into a log file while I'm developing or debugging, but I still want to have my logs written to disk on production though. Is there a better way of achieving that? Rodrigue On Jul 13, 12:26 pm, Rodrigue <rodriguealca...@gmail.com> wrote: > Hi all, > > I have been > usingdjango-logging(http://code.google.com/p/django-logging/wiki/Overview) > and found it very useful. However, I configured > python logging for my project anddjango-loggingdoes not display > logging messages anymore. > > Here is the logging.conf I am using: > > [loggers] > keys = root,xxx > > [handlers] > keys = xxxHandler > > [formatters] > keys = defaultFormatter > > # Loggers > # ========== > > [logger_root] > level = ERROR > handlers = xxxHandler > > [logger_xxx > level = DEBUG > handlers = xxxHandler > qualname = xxx > propagate = 0 > > # Handlers > # ========== > > [handler_xxxHandler] > class = handlers.RotatingFileHandler > level = DEBUG > args = ("/tmp/logs/xxx.log", 'a', 50000, 3) > formatter = defaultFormatter > > # Formatters > # ========== > > [formatter_defaultFormatter] > format = %(asctime)s [%(threadName)s] - %(pathname)s:[%(lineno)d] - % > (levelname)s - %(message)s > datefmt = %d-%m-%y %H:%M:%S > > I then grab my logger via: logging.getLogger(__name__) > > I can see all my log in the expected file, but thedjango-logginghtml > does not show them. > > I see thedjango-loggingadded to the bottom of my pages but it only > says: no log entries. > > Having had a look at thedjango-loggingmiddleware module, I found > this: > > # Initialise and register the handler > handler = ThreadBufferedHandler() > logging.root.setLevel(logging.NOTSET) > logging.root.addHandler(handler) > > So my understanding is that it only attaches a handler to the root > logger but the root logger does not get called/used (not sure what the > correct term is regarding the logging module). > > I have tried setting propagate=1 in my logging.conf, hoping that my > log messages would be propagated to the root logger but no... > > Quite perplexed as to what the config is supposed to be. > > Any idea anyone? > > Rodrigue --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---