graypy.rabbitmq module¶
Logging Handler integrating RabbitMQ and Graylog Extended Log Format (GELF)
-
class
graypy.rabbitmq.
ExcludeFilter
(name)[source]¶ Bases:
logging.Filter
A subclass of
logging.Filter
which 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
’sname
field 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.SocketHandler
RabbitMQ / 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.LogRecord
into bytes representing a GELF log- Parameters
record (logging.LogRecord) –
logging.LogRecord
to convert into a GELF log.- Returns
bytes representing a GELF log.
- Return type
-