severb / graypy

Python logging handler for Graylog that sends messages in GELF (Graylog Extended Log Format).
https://www.graylog.org/
BSD 3-Clause "New" or "Revised" License
258 stars 90 forks source link

Support for GELF TCP with TLS? #110

Closed pratibhajagnere closed 5 years ago

pratibhajagnere commented 5 years ago

Hi,

I want secure communication to graylog. So I decided to use GELF TCP with TLS.

Does graypy supports it?

nklapste commented 5 years ago

graypy does support GELF TCP with TLS with the GELFTLSHandler!

import logging

from graypy import GELFTLSHandler

handler = GELFTLSHandler("127.0.0.1", 12204, validate=True, ca_certs="localhost.cert.pem")
logger = logging.getLogger("test_logger")
logger.addHandler(handler)

logger.critical("critical and secure GELF log!")