Logging configuration

Fleio uses default python logger for logging and configured via django settings (see Django logging configuration).

Python logger supports the following levels in descending order: CRITICAL, ERROR, WARNING, INFO, DEBUG.

Starting from 2020.11.0 release Fleio adds a custom log level, FLEIO_ACTIVITY between ERROR and WARNING. FLEIO_ACTIVITY is the log level configured by default in a clean Fleio installation.

The logger will log all messages with the level greater or equal to the configured log level(e.g. if the configured log level is INFO the logger will log messages with CRITICAL, ERROR, FLEIO_ACTIVITY, WARNING and INFO).

Below there are some code snippets that enable various log levels. Add these to settings.py file. Note that staring from version 2020.11.0 you should find this snippets commented out in settings.py file in a clean Fleio installation.

To edit the settings.py file run fleio edit settings.py command.

Enable DEBUG logging

LOGGING['root']['level'] = 'DEBUG'
LOGGING['handlers']['stdout']['level'] = 'DEBUG'

Enable INFO logging

LOGGING['root']['level'] = 'INFO'

Enable WARNING logging

LOGGING['root']['level'] = 'WARNING'

Disable mail admins

LOGGING['root']['handlers'].remove('mail_admins')

Mail admins when DEBUG=True

If DEBUG=True is set on your installation, critical logs and exceptions are not emailed. To change this behaviour, edit settings.py and add:

LOGGING['handlers']['mail_admins']['filters'] = ['allow_only_critical_and_exceptions']