Adding new handler to the storm logger
yugansh20 opened this issue · 0 comments
yugansh20 commented
I have a custom log handler created and would like to push logs to this handler as well.
I am calling following function in all the bolts initialize -
def set_from_conf(component, stormconf):
global log
log = component.log
for key, value in stormconf.items():
if key.startswith('project.'):
const = key.split(".")[1].upper()
if const not in globals():
raise ValueError("Unknown setting '{}' in config.json".format(key))
globals()[const] = value
Can I do something like -
component.logger = get_custom_logger()
Or just
import logging
logging.getLogger().addHanlder(customHandler)