graypy.rabbitmq module¶
Logging Handler integrating RabbitMQ and Graylog Extended Log Format (GELF)
-
class
graypy.rabbitmq.ExcludeFilter(name)[source]¶ Bases:
logging.FilterA subclass of
logging.Filterwhich should be instantiated with the name of the logger which, together with its children, will have its events excluded (filtered out)-
__init__(name)[source]¶ Initialize the ExcludeFilter
- Parameters
name (str) – Name to match for within a
logging.LogRecord’snamefield for filtering.
-
-
class
graypy.rabbitmq.GELFRabbitHandler(url, exchange='logging.gelf', exchange_type='fanout', virtual_host='/', routing_key='', **kwargs)[source]¶ Bases:
graypy.handler.BaseGELFHandler,logging.handlers.SocketHandlerRabbitMQ / GELF handler
Note
This handler ignores all messages logged by amqplib.
-
__init__(url, exchange='logging.gelf', exchange_type='fanout', virtual_host='/', routing_key='', **kwargs)[source]¶ Initialize the GELFRabbitHandler
-
makePickle(record)[source]¶ Convert a
logging.LogRecordinto bytes representing a GELF log- Parameters
record (logging.LogRecord) –
logging.LogRecordto convert into a GELF log.- Returns
bytes representing a GELF log.
- Return type
-