Skip to content

Adding new handler to the storm logger #475

@yugansh20

Description

@yugansh20

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions