Some time ago Iceberg suggesting adding the following model for
logging:

Add following codes inside model/log.py:

 def _init_log():
   import logging
   logger=logging.getLogger(request.application)
   logger.setLevel(logging.DEBUG)
   handler=logging.FileHandler("%s.log"%request.application)
   handler.setLevel(logging.DEBUG)
   handler.setFormatter(logging.Formatter(
     "%(levelname)s %(asctime)s %(funcName)s %(lineno)d %(message)
s"))
   logger.addHandler(handler)
   return logger
 logging=cache.ram('once',lambda:_init_log(),time_expire=99999999)

On Sep 28, 7:32 am, Roar <[email protected]> wrote:
> I've added the following to the default.py controller:
>
> import logging
> LOG_FILENAME = '/tmp/log/log.txt'
> logging.basicConfig(filename=LOG_FILENAME,level=logging.DEBUG,)
>
> logging.debug('This message should go to the log file, but it does
> not')
>
> ...but nothing is being logged. Any ideas?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to