Load dot env before utils, allow setting STRAPI_LOG_LEVEL in env file #6693
Comments
Hello! thank you for reporting that, can you please submit a PR. |
@lauriejim @aksdevac STRAPI_LOG_LEVEL does work finely inside the logger of strapi. I had checked the variable outputs. The logs is getting printed due to logger middleware which has default value as debug. To change the level, in create/existing config/middleware.js add like this. It can be also env. If you want I can submit a PR that checks for the process.env.STRAPI_LOG_LEVEL and take that as log level. |
@lauriejim Hi, submitted PR #6701 but it might not fix issue, as middleware is overriding default log level as mentioned in PR & by @akhilmhdh, but can be used for |
There is another way of making this work. Export your
|
This is the correct method |
Describe the bug
If I set
STRAPI_LOG_LEVEL
variable in .env file it does not work because log utils are loaded before dotenvSteps to reproduce the behavior
STRAPI_LOG_LEVEL
in env file & see if it worksExpected behavior
Env vars from
.env
file should be loaded before starpi-utils loggerSystem
The text was updated successfully, but these errors were encountered: