File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ def get_logger(name: str) -> logging.Logger:
31
31
32
32
def log_filter (record : logging .LogRecord ) -> bool :
33
33
"""
34
- Function used to determine if a log record should be outputted or not.
34
+ Function used to determine if a log record should be outputted or not (True = output, False = skip) .
35
35
36
36
This function will:
37
37
- Log all records with a level of ERROR or higher with telemetry
@@ -50,7 +50,7 @@ def log_filter(record: logging.LogRecord) -> bool:
50
50
# If rate limiting has been disabled (`DD_TRACE_LOGGING_RATE=0`) then apply no rate limit
51
51
# If the logger is set to debug, then do not apply any limits to any log
52
52
if not _rate_limit or logger .getEffectiveLevel () == logging .DEBUG :
53
- return False
53
+ return True
54
54
# Allow 1 log record by name/level/pathname/lineno every X seconds
55
55
# DEV: current unix time / rate (e.g. 300 seconds) = time bucket
56
56
# int(1546615098.8404942 / 300) = 515538
@@ -72,9 +72,9 @@ def log_filter(record: logging.LogRecord) -> bool:
72
72
# Reset our bucket
73
73
_buckets [key ] = LoggingBucket (current_bucket , 0 )
74
74
# Actually log this record
75
- return False
75
+ return True
76
76
# Increment the count of records we have skipped
77
77
# DEV: `buckets[key]` is a tuple which is immutable so recreate instead
78
78
_buckets [key ] = LoggingBucket (logging_bucket .bucket , logging_bucket .skipped + 1 )
79
79
# Skip this log message
80
- return True
80
+ return False
You can’t perform that action at this time.
0 commit comments