Search code examples
daphne

Daphne not logging errors


I have the following systemd config

[Service]
WorkingDirectory=/srv/www/project_a/project_a/
Environment=JSON_SETTINGS=/srv/www/project_a/project_a.json
ExecStart=/srv/www/project_a/bin/daphne -b 0.0.0.0 -p 8000 project_a.asgi:channel_layer
Restart=always
KillSignal=SIGTERM
NotifyAccess=all
StandardOut=file:/tmp/daphne-access.log
StandardError=file:/tmp/daphne-error.log

But the daphne-access.log and daphone-error.log files are both empty, I thought daphne's default logging out be outputting to stdout?

Tried: --access-log=/tmp/daphne-access.log which worked for access logs, but don't know where to get django errors when they happen.


Solution

  • Just add the following to your LOGGING['loggers'] settings:

    'daphne': {
        'handlers': [
            'console',
        ],
        'level': 'DEBUG'
    },