Skip to content

Commit eda6bde

Browse files
committed
use logger effective level
1 parent b79436b commit eda6bde

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ddtrace/internal/logger.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ def log_filter(record: logging.LogRecord) -> bool:
4545
full_file_name = os.path.join(record.pathname, record.filename)
4646
telemetry.telemetry_writer.add_error(1, record.msg % record.args, full_file_name, record.lineno)
4747

48+
logger = logging.getLogger(record.name)
49+
4850
# If rate limiting has been disabled (`DD_TRACE_LOGGING_RATE=0`) then apply no rate limit
49-
# If the record is debug, then do not apply any limits to any log
50-
# DEV: we rely on the logging level of the handler/logger to filter out debug logs
51-
if not _rate_limit or record.levelno == logging.DEBUG:
51+
# If the logger is set to debug, then do not apply any limits to any log
52+
if not _rate_limit or logger.getEffectiveLevel() == logging.DEBUG:
5253
return False
5354
# Allow 1 log record by name/level/pathname/lineno every X seconds
5455
# DEV: current unix time / rate (e.g. 300 seconds) = time bucket

0 commit comments

Comments
 (0)