MessageQueueBackend

Message Queue wrapper

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

Bases: DIRAC.Resources.LogBackends.AbstractBackend.AbstractBackend

MessageQueueBackend is used to create an abstraction of the handler and the formatter concepts from logging. Here, we have:

  • MessageQueueHandler: which is a custom handler created in DIRAC to send log records to a Message Queue server. You can find it in: FrameworkSys./private/standardlogging/Handler

  • BaseFormatter: is a custom Formatter object, created for DIRAC in order to get the appropriate display.

You can find it in FrameworkSystem/private/standardLogging/Formatter

__init__(backendParams=None)

Initialization of the MessageQueueBackend

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

class DIRAC.Resources.LogBackends.MessageQueueBackend.MicrosecondJsonFormatter(*args: Any, **kwargs: Any)

Bases: pythonjsonlogger.jsonlogger.JsonFormatter

__init__(*args: Any, **kwargs: Any) None
formatTime(record, datefmt=None)

logging.Formatter.formatTime() with microsecond precision by default