dosubot[bot] commented on issue #37928:
URL: https://github.com/apache/superset/issues/37928#issuecomment-3890847745
<!-- Answer -->
That's right—SUPERSET_LOG_LEVEL isn't automatically used by Superset in
production or Docker; it's not read by the codebase unless you explicitly wire
it up in your config. The log level is actually controlled by the LOG_LEVEL
config variable, which you can set in your superset_config.py by reading from
any environment variable you want (for example, LOG_LEVEL or
SUPERSET_LOG_LEVEL). FLASK_DEBUG (or the DEBUG flag) only toggles debug mode,
not the log level directly.
If you want to control logging via environment variables, add something like
this to your superset_config.py:
```python
import os
LOG_LEVEL = os.environ.get("LOG_LEVEL", "INFO")
```
Then set LOG_LEVEL in your environment. This will work in both dev and
production. If you want to keep using SUPERSET_LOG_LEVEL, just change the
variable name in the code above. Superset doesn't automatically pick up either
one—you have to connect them yourself in the config file.
Let me know if you want a more detailed example or have questions about
other config overrides!
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
---
<sup>How did I do?
[Good](https://app.dosu.dev/response-feedback/cfc09fe4-9cac-4e6c-a77a-6d4dc4bcacd1?feedback_type=great_response)
|
[Irrelevant](https://app.dosu.dev/response-feedback/cfc09fe4-9cac-4e6c-a77a-6d4dc4bcacd1?feedback_type=irrelevant_answer)
|
[Incorrect](https://app.dosu.dev/response-feedback/cfc09fe4-9cac-4e6c-a77a-6d4dc4bcacd1?feedback_type=incorrect_sources)
|
[Verbose](https://app.dosu.dev/response-feedback/cfc09fe4-9cac-4e6c-a77a-6d4dc4bcacd1?feedback_type=too_verbose)
|
[Hallucination](https://app.dosu.dev/response-feedback/cfc09fe4-9cac-4e6c-a77a-6d4dc4bcacd1?feedback_type=hallucination)
| [Report
🐛](https://app.dosu.dev/response-feedback/cfc09fe4-9cac-4e6c-a77a-6d4dc4bcacd1?feedback_type=bug_report)
|
[Other](https://app.dosu.dev/response-feedback/cfc09fe4-9cac-4e6c-a77a-6d4dc4bcacd1?feedback_type=other)</sup>
[](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](https://cursor.com/link/prompt?text=That%27s%20right%E2%80%94SUPERSET_LOG_LEVEL%20isn%27t%20automatically%20used%20by%20Superset%20in%20production%20or%20Docker%3B%20it%27s%20not%20read%20by%20the%20codebase%20unless%20you%20explicitly%20wire%20it%20up%20in%20your%20config.%20The%20log%20level%20is%20actually%20controlled%20by%20the%20LOG_LEVEL%20config%20variable%2C%20which%20you%20can%20set%20in%20your%20superset_config.py%20by%20reading%20from%20any%20environment%20variable%20you%20want%20%28for%20example%2C%20LOG_LEVEL%20or%20SUPERSET_LOG_LEVEL%29.%20FLASK_DEBUG%20%28or%20the%20DEBUG%20flag%29%20only%20toggles%20debug%20mode%2C%20not%20the%20log%20level%20directly.%0A%0AIf%20you%20want%20to%20control%20logging%20via%20environment%20variables%2C%20add%20something%20like%20this%20t
o%20your%20superset_config.py%3A%0A%0A%60%60%60python%0Aimport%20os%0ALOG_LEVEL%20%3D%20os.environ.get%28%22LOG_LEVEL%22%2C%20%22INFO%22%29%0A%60%60%60%0A%0AThen%20set%20LOG_LEVEL%20in%20your%20environment.%20This%20will%20work%20in%20both%20dev%20and%20production.%20If%20you%20want%20to%20keep%20using%20SUPERSET_LOG_LEVEL%2C%20just%20change%20the%20variable%20name%20in%20the%20code%20above.%20Superset%20doesn%27t%20automatically%20pick%20up%20either%20one%E2%80%94you%20have%20to%20connect%20them%20yourself%20in%20the%20config%20file.%20%0A%0ALet%20me%20know%20if%20you%20want%20a%20more%20detailed%20example%20or%20have%20questions%20about%20other%20config%20overrides%21) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache
/superset/issues/37928)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]