ElasticSearchBackend

ElasticSearch wrapper

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

Bases: 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.

__init__(backendParams=None, backendFilters=None)

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

getHandler()
Returns:

the handler

setLevel(levelName)

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

Parameters:

level (int) – a level