syslog.relp_client

RELP syslog client

class RELPClient(server, port, use_ssl=False, verify_cert=True, hostname=None, ca_certs=None, client_key=None, client_cert=None, server_deadline=120)[source]

Bases: pyloggr.syslog.base.GenericClient

Utility class to send messages or whole files to a RELP server, using an asynchrone TCP client

Parameters:
  • server (str) – RELP server hostname or IP
  • port (int) – RELP server port
  • use_ssl (bool) – Should the client connect with SSL
send_events(events, frmt="RFC5424")[source]

Send multiple events to the RELP server

Parameters:
  • events (iterable of Event) – events to send (iterable of Event)
  • frmt (str) – event dumping format
  • compress (bool) – if True, send the events as one LZ4-compressed line
start()[source]

Connect to the RELP server and send ‘open’ command

Raises socket.error:
 if TCP connection fails

Note

Tornado coroutine

stop()[source]

Disconnect from the RELP server