ElasticSearch wrapper

class DIRAC.Resources.LogBackends.ElasticSearchBackend.ElasticSearchBackend(backendParams=None)

Bases: DIRAC.Resources.LogBackends.AbstractBackend.AbstractBackend

ElasticsearchBackend is used to create an abstraction of the handler and the formatter concepts from logging. Here, we have a CMRESHandler which is part of an external library named ‘cmreslogging’ based on ‘logging’. CMRESHandler is a specific handler created to send log records to an ElasticSearch DB. It does not need a Formatter object.


CMRESHandler needs, at least, a hostname, a username, a password, a port and a specific index from the ElasticSearch DB to send log records.


the handler


Configure the level of the handler associated to the backend. Make sure the handler has been created before calling the method.


level (int) – a level