Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding new handler to the storm logger #475

Open
yugansh20 opened this issue Jan 30, 2020 · 0 comments
Open

Adding new handler to the storm logger #475

yugansh20 opened this issue Jan 30, 2020 · 0 comments

Comments

@yugansh20
Copy link

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant