Open cmpadden opened 3 months ago
It's very possible that this is a simple misunderstanding on how --log-level
should function, but I wanted to get clarification. Thanks.
https://docs.dagster.io/_apidocs/cli#cmdoption-dagster-dev-log-level
According to what I'm seeing in the code base, it's likely this is intended behavior when logging step, job, and resource events. I reproduced this behavior during asset materialization.
The log_step_event(), log_job_event(), and log_resource() functions each log using the log_dagster_event() function in the DagsterLogManager class.
DagsterLogManager inherits from Python's logging.Logger class and overrides the log() function.
Within this overridden function, we see that the previous authors intended to log Dagster events regardless of level by adding the "or" clause to what is usually a simple check to determine whether the log level is enabled for the logger.
From line 421 in python_modules/dagster/dagster/_core/log_manager.py:
# log DagsterEvents regardless of level
if self.isEnabledFor(level) or (
"extra" in kwargs and LOG_RECORD_EVENT_ATTR in kwargs["extra"]
):
self._log(level, msg, args, **kwargs)
Based on this observation, I recommend this ticket be closed if this is, in fact, the intended behavior.
Dagster version
dagster, version 1.7.3
What's the issue?
Setting the
--log-level
and--code-server-log-level
flags does not suppress logging incontext.log
messages.However, setting
python_log_level
indagster.yaml
works as expected.Is this intended behavior, or a possible bug?
What did you expect to happen?
I would expect setting
--log-level warning
on the CLI would suppressINFO
level statements.How to reproduce?
No response
Deployment type
Local
Deployment details
No response
Additional information
See Slack conversation here: https://dagster.slack.com/archives/C01U954MEER/p1717678439716179
Message from the maintainers
Impacted by this issue? Give it a 👍! We factor engagement into prioritization.