INNER CODE UNIT · Python

NoPingFilter

Mailu/Mailu · core/admin/mailu/__init__.py:13

class NoPingFilter(logging.Filter):
    skipAccessLogs = False

    def __init__(self, filterAccessLogs=False):
        self.skipAccessLogs = filterAccessLogs

    def filter(self, record):
        if self.skipAccessLogs and record.args['r'].endswith(' HTTP/1.1'):
            return False
        if record.args['r'].endswith(' /ping HTTP/1.1'):
            return False
        if record.args['r'].endswith(' /internal/rspamd/local_domains HTTP/1.1'):
            return False
        return True

class Logger(glogging.Logger):
    def setup(self, cfg):
        super().setup(cfg)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…