On Aug 29, 2010, at 10:26 AM, mart wrote:
> 
> Working great now! Thanks for that :)

A favor, please, Mart. In main.py, you'll find this logging init code:

logpath = os.path.join(web2py_path, "logging.conf")
if os.path.exists(logpath):
    logging.config.fileConfig(os.path.join(web2py_path, "logging.conf"))
logger = logging.getLogger("web2py")



In the configuration that terminates for you (2.7 and no logging.conf, I 
believe), try adding an else clause to the above, thus:

logpath = os.path.join(web2py_path, "logging.conf")
if os.path.exists(logpath):
    logging.config.fileConfig(os.path.join(web2py_path, "logging.conf"))
else:
    logging.basicConfig()
logger = logging.getLogger("web2py")


Hopefully that will solve the termination problem, in which case we'll want 
that patch for 2.7 (and it should do no harm before that). I have to think it's 
a 2.7 bug, but who knows?

Also, Mart, can you try that python command-line test under 2.7?

> 
> On Aug 29, 1:06 pm, Jonathan Lundell <[email protected]> wrote:
>> On Aug 29, 2010, at 9:46 AM, mart wrote:
>> 
>> 
>> 
>> 
>> 
>>> So, I just downloaded the src 
>>> fromhttp://web2py.com/examples/static/nightly/web2py_src.zip,
>>> just in case there are changes since last night. I am on mac os 10.6.4
>>> and this is what I get (copied from terminal):
>> 
>>> macmart:web2py_184 mart$ python web2py.py
>>> Warning: web2py requires Python 2.4, 2.5 (recommended), or 2.6 but you
>>> are running:
>>> 2.7 (r27:82508, Jul  3 2010, 21:12:11)
>>> [GCC 4.0.1 (Apple Inc. build 5493)]web2py Enterprise Web Framework
>>> Created by Massimo Di Pierro, Copyright 2007-2010
>>> Version 1.84.0 (2010-08-29 06:19:04)
>>> Database drivers available: SQLite3
>>> Starting hardcron...
>>> No handlers could be found for logger "web2py"
>>> choose a password:*********
>>> please visit:
>>>    http://127.0.0.1:8000
>>> use "kill -SIGTERM 1746" to shutdown the web2py server
>>> macmart:web2py_184 mart$
>> 
>>> So, we still notice the same error "No handlers could be found for
>>> logger "web2py"" and the I am brought back to the terminal cursor.
>> 
>>> So, now on to Jonathan's suggestion.
>> 
>>> SO, now I/ looking for logging.example.conf but can't find it, does it
>>> usually come with the src? Or what should the contents be? I did see
>>> some references to that file in a few place though...
>> 
>> It should be in the root directory, as part of the distribution (it's a new 
>> file); if it's not, it must have something to do with how the distribution 
>> is created. Massimo?
>> 
>> In the meantime, try the following (plain text file):
>> 
>> [loggers]
>> keys=root,rocket,markdown,web2py,rewrite,app,welcome
>> 
>> # the default configuration is console-based (stdout) for backward 
>> compatibility
>> #
>> # note that file-based handlers are thread-safe but not mp-safe;
>> # for mp-safe logging, configure the appropriate syslog handler
>> 
>> [handlers]
>> keys=consoleHandler
>> #keys=consoleHandler,rotatingFileHandler
>> #keys=osxSysLogHandler
>> 
>> [formatters]
>> keys=simpleFormatter
>> 
>> [logger_root]
>> level=WARNING
>> handlers=consoleHandler
>> 
>> [logger_web2py]
>> level=WARNING
>> handlers=consoleHandler
>> qualname=web2py
>> propagate=0
>> 
>> [logger_rewrite]
>> level=WARNING
>> qualname=web2py.rewrite
>> handlers=consoleHandler
>> propagate=0
>> 
>> # generic app handler
>> [logger_app]
>> level=WARNING
>> qualname=web2py.app
>> handlers=consoleHandler
>> propagate=0
>> 
>> # welcome app handler
>> [logger_welcome]
>> level=WARNING
>> qualname=web2py.app.welcome
>> handlers=consoleHandler
>> propagate=0
>> 
>> # loggers for legacy getLogger calls: Rocket and markdown
>> [logger_rocket]
>> level=WARNING
>> handlers=consoleHandler
>> qualname=Rocket
>> propagate=0
>> 
>> [logger_markdown]
>> level=WARNING
>> handlers=consoleHandler
>> qualname=markdown
>> propagate=0
>> 
>> [handler_consoleHandler]
>> class=StreamHandler
>> level=WARNING
>> formatter=simpleFormatter
>> args=(sys.stdout,)
>> 
>> # Rotating file handler
>> #   mkdir logs in the web2py base directory if not already present
>> #   args: (filename[, mode[, maxBytes[, backupCount[, encoding[, delay]]]]])
>> #
>> [handler_rotatingFileHandler]
>> class=handlers.RotatingFileHandler
>> level=INFO
>> formatter=simpleFormatter
>> args=("logs/web2py.log", "a", 1000000, 5)
>> 
>> [handler_osxSysLogHandler]
>> class=handlers.SysLogHandler
>> level=WARNING
>> formatter=simpleFormatter
>> args=("/var/run/syslog", handlers.SysLogHandler.LOG_DAEMON)
>> 
>> [handler_linuxSysLogHandler]
>> class=handlers.SysLogHandler
>> level=WARNING
>> formatter=simpleFormatter
>> args=("/dev/log", handlers.SysLogHandler.LOG_DAEMON)
>> 
>> [handler_remoteSysLogHandler]
>> class=handlers.SysLogHandler
>> level=WARNING
>> formatter=simpleFormatter
>> args=(('sysloghost.domain.com', handlers.SYSLOG_UDP_PORT), 
>> handlers.SysLogHandler.LOG_DAEMON)
>> 
>> [formatter_simpleFormatter]
>> format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
>> datefmt=


Reply via email to