ServerBackend wrapper

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

Bases: AbstractBackend

ServerBackend is used to create an abstraction of the handler and the formatter concepts from logging. Here, we gather a ServerHandler object and a BaseFormatter.

  • ServerHandler is a custom handler object, created for DIRAC because it has no equivalent: it is used to write log messages in a server DIRAC service: SystemLogging from FrameworkSystem. You can find it in FrameworkSystem/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


Initialization of the backend. _handler and _formatter can be custom objects. If it is the case, you can find them in FrameworkSystem/private/standardLogging/Formatter or Handler.

  • _handler – handler object from ‘logging’. Ex: StreamHandler(), FileHandler()…

  • _formatter – the name of a formatter object from logging. Ex: BaseFormatter

  • backendParams (dict) – parameters to set up the backend

  • _datefmt (str) – parameters to set up the formatter (e.g. fmt, the format, and datefmt, the date format)

  • _level (str) – level of the handler


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