/
Logging in VogonWeb

Logging in VogonWeb

The documentation for logging in Django can be found [here|https://docs.djangoproject.com/en/1.9/topics/logging/].

To use the logger, import the logging module.

import logging

Then get a logger for that namespace 

logger = logging.getLogger(__name__)

The logging configuration can be found in the settings module. For example, in local_settings.py:

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'handlers': {
        'console': {
            'class': 'logging.StreamHandler',
        },
    },
    'loggers': {
        'django': {
            'handlers': ['console'],
            'level': os.getenv('DJANGO_LOG_LEVEL', 'INFO'),
        },
    },
}

You can tweak the "DJANGO_LOG_LEVEL" parameter to enable/disable log messages at different levels.