<#1262 fix(logging): forward USER_LOG_LEVEL to tas...
# flyte-github
a
#1262 fix(logging): forward USER_LOG_LEVEL to task pods Pull request opened by pingsutw Why Reported in Slack: on a remote
flyte run
, setting both
LOG_LEVEL
and
USER_LOG_LEVEL
in the shell only forwards
LOG_LEVEL
to the task pod —
USER_LOG_LEVEL
is dropped.
Copy code
LOG_LEVEL=DEBUG USER_LOG_LEVEL=DEBUG flyte run ...   # only LOG_LEVEL reaches the pod
flyte run -e LOG_LEVEL=DEBUG -e USER_LOG_LEVEL=DEBUG  # both reach the pod
Root cause: in
_Runner._build_env_dict
,
LOG_LEVEL
always gets injected (it falls back to
logger.getEffectiveLevel()
), but
USER_LOG_LEVEL
was only set when explicitly threaded through
with_runcontext
— which the CLI doesn't do. What
_build_env_dict
now mirrors
LOG_LEVEL
for `USER_LOG_LEVEL`: falls back to
user_logger.getEffectiveLevel()
, so a shell-set value reaches the pod on both the CLI and direct-script paths. Tests •
tests/flyte/test_run_log_env.py
—
USER_LOG_LEVEL
fallback / precedence in
_build_env_dict
. flyteorg/flyte-sdk