itamarst / eliot

Eliot: the logging system that tells you *why* it happened
https://eliot.readthedocs.io
Apache License 2.0
1.11k stars 66 forks source link

adding handler to Eliot logger, for integration with Betterstack #500

Open eden-chan opened 8 months ago

eden-chan commented 8 months ago

I want to store my logs in BetterStack, is there a way to add a handler to listen to the output Eliot logs?

import logging
from logtail import LogtailHandler
logTailHandler = LogtailHandler(source_token="SOURCE_ID")

logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
logger.handlers = []
logger.addHandler(EliotHandler())
logger.addHandler(logTailHandler)