Logging

From Mayan EDMS Wiki
Jump to: navigation, search

Official docs

Available Loggers[edit]

  • maybe a list?

Logging to logstash[edit]

You can output the mayan (webinterface) logs to a central logging instance of logstash. First you must install the python package within your virtual environment in which you installed mayan EDMS.

   /opt/mayan-edms/bin/pip install --no-cache-dir python-logstash

Then you will have to modify your local.py settings file to use logstash.

LOGGING = {
        'version': 1, # needed for django
        'handlers': {                                                                                                                                                           
            'logstash': {
                'level': 'DEBUG',
                'class': 'logstash.LogstashHandler',
                'host': 'logstashhost', # you will have to provide your own ;-)
                'port': 5959, # Default value: 5959
                'version': 1, # Version of logstash event schema. Default value: 0 (for backward compatibility of the library)
                'message_type': 'logstash',  # 'type' field in logstash message. Default value: 'logstash'.
                'fqdn': False, # Fully qualified domain name. Default value: false.
                }
            },
        'loggers': {
            'documents': {
                'handlers':['logstash'], # the name refers to the handler name in this case "logstash"
                'propagate': True,
                'level':'DEBUG',
                },
            'converter': {
                'handlers':['logstash'],
                'propagate': True,
                'level':'DEBUG',
                },
            'django': {
                'handlers':['logstash'],
                'propagate': True,
                'level':'INFO', # DEBUG possible but VERY verbose
                },
            }
        }

More info for python-logstash

Logging for workers[edit]

I do not know how to setup logging for the celery workers.