New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
load dotenv lib at start #6701
load dotenv lib at start #6701
Conversation
allows setting STRAPI_LOG_PRETTY_PRINT, STRAPI_LOG_LEVEL etc in env file Signed-off-by: Akash P <aksdevac@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #6701 +/- ##
==========================================
+ Coverage 19.86% 20.05% +0.19%
==========================================
Files 857 858 +1
Lines 12078 12050 -28
Branches 1963 1951 -12
==========================================
+ Hits 2399 2417 +18
+ Misses 8094 8062 -32
+ Partials 1585 1571 -14
Continue to review full report at Codecov.
|
packages/strapi/lib/Strapi.js
Outdated
@@ -1,6 +1,14 @@ | |||
'use strict'; | |||
|
|||
// Dependencies. | |||
const dotenv = require('dotenv'); | |||
|
|||
if(process.env.ENV_PATH) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to do the if statement here :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok removed it.
Signed-off-by: Akash P <aksdevac@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ! thanks :)
* load dotenv lib at start allows setting STRAPI_LOG_PRETTY_PRINT, STRAPI_LOG_LEVEL etc in env file Signed-off-by: Akash P <aksdevac@gmail.com> * remove extra if statement Signed-off-by: Akash P <aksdevac@gmail.com> Signed-off-by: Gil Fernandes <gil.fernandes@onepointltd.com>
allows setting STRAPI_LOG_PRETTY_PRINT, STRAPI_LOG_LEVEL etc in env file
Description of what you did:
Load env vars from env file at starpi start, allows setting STRAPI_LOG_LEVEL, STRAPI_LOG_PRETTY_PRINT, STRAPI_LOG_TIMESTAMP etc related to #6693.
but it might not fix it as middleware config is overriding log level to 'debug', using default json file, not sure if I can use this env variable(STRAPI_LOG_LEVEL) in that logger middlerware's defaults json file, but it allows use of other vars like STRAPI_LOG_PRETTY_PRINT, STRAPI_LOG_TIMESTAMP & STRAPI_LOG_FORCE_COLOR