Sylwester Kardziejonek
Sylwester Kardziejonek

Reputation: 592

Pyramid uWSGI logging in daemon mode is not working

I've been trying multiple things on this one, but with no success. I want to save log to file (SqlAlchemy logs, app debug logs, stack traces on errors, etc.).

I'm starting uwsgi with the following command: uwsgi --ini-paste-logged myapp.ini

And here is the content of the ini file (where apiservice is my pakage)

[loggers]
keys = root, apiservice, sqlalchemy

[handlers]
keys = console

[formatters]
keys = generic

[logger_root]
level = INFO
handlers = console

[logger_apiservice]
level = DEBUG
handlers =
qualname = apiservice

[logger_sqlalchemy]
level = INFO
handlers =
qualname = sqlalchemy.engine

[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic

[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s

[uwsgi]
socket = /tmp/myapp-uwsgi.sock
virtualenv = /var/www/myapp/env
pidfile = ./uwsgi.pid
daemonize = ./uwsgi.log
master = true
processes = 4

The uwsgi.log contains only request log, without any actual logging data.

I've tried with INI options like:

Nothing seem to work.

Upvotes: 2

Views: 927

Answers (1)

Sylwester Kardziejonek
Sylwester Kardziejonek

Reputation: 592

Apparently, the uwsgi config section was fine. After closer look at the uwsgi.log, even though the server was launched and running successfully, you could see an error:

ImportError: No module named script.util.logging_config

I've installed following packages to solve my problems:

pip install pastescript
pip install pastedeploy

Upvotes: 3

Related Questions