-
Notifications
You must be signed in to change notification settings - Fork 135
Open
Description
I find my self doing this:
class CustomUDPLogstashHandler(logstash.UDPLogstashHandler):
def __init__(self, *a, **kw):
self.global_extras = kw.pop('global_extras', {})
super().__init__(*a, **kw)
def emit(self, record):
for key, value in self.global_extras.items():
setattr(record, key, value)
super().emit(record)
LOGGING={
...
'logstash': {
'level': 'DEBUG',
'class': 'util.CustomUDPLogstashHandler',
'host': 'logstash.service',
'port': 5000,
'version': 1,
'tags': ['tag1', 'tag2'],
'global_extras': {
'product': "my_test_product",
'instance': "my_test_instance",
'site': 333
}
}
...
It would be cool if that functionality were included
jtmoon79, kwyckmans, dmcallejo and mrodm
Metadata
Metadata
Assignees
Labels
No labels