Skip to content
This repository was archived by the owner on Nov 5, 2023. It is now read-only.
This repository was archived by the owner on Nov 5, 2023. It is now read-only.

Infinite loop logging... #26

@chander

Description

@chander

It might be useful to let folks know that if they turn on urllib3.connectionpool logging (at DEBUG) - or enable debug logging at the root logger, they'll likely run into a recursion loop; as slacker logging triggers log events from urllib3.connectionpool.

I handle this by making sure I filter out slack.com messages - that might be a good default for the slacker log handler in general...

filter_func=lambda record: (int(record.name.split('.',1)[0] not in ('urllib3.connectionpool',) and 
                                              'slack.com' not in record.getMessage()))
    
slack_handler = SlackerLogHandler(...)
# Get some useful information in log output.
format_string='''%(levelname)s: %(asctime)s %(name)s[%(lineno)d]: %(message)s'''
formatter=NoStacktraceFormatter(format_string)
slack_handler.setFormatter(formatter)
slack_handler.addFilter(filter_func)
slack_handler.setLevel(logging.DEBUG)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions