web2py / py4web

Other
244 stars 126 forks source link

Logging issues #874

Closed nicozanf closed 1 month ago

nicozanf commented 3 months ago

Logging to a file does not seem to work. For example:

./py4web.py run apps --errorlog /home/nico/py4web/error.log -L 20

does not create any log file, even if I've got outputs on the screen.

Also, I think the debug option should have a better logging_level. Now it's fixed to 0, which is nothing, and this is quite counter-intuitive ;-(

nicozanf commented 1 month ago

I've discovered that file logging setting used on command line (processed on core.py) is totally ignored. Instead, the value of PY4WEB_LOGS env variable is used if present (see https://github.com/web2py/py4web/blob/a007f1436751ade0ba90bc8dfcdd5bfb83adace6/py4web/server_adapters.py#L29 ). I think we should change it according to the manual, but issue a warning if someone is now using PY4WEB_LOGS.