Skip to content

Commit

Permalink
Merge pull request #811 from Giveth/feat/logger_stdout
Browse files Browse the repository at this point in the history
Add LOG_STDOUT support
  • Loading branch information
mohammadranjbarz authored Jan 24, 2023
2 parents 5dce9c9 + 22cdeb0 commit 0f06e0a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions config/test.env
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,5 @@ ONRAMPER_SECRET=secreto
ENABLE_GIV_POWER_TESTING=true
THIRD_PARTY_PROJECTS_ADMIN_USER_ID=4

# OPTIONAL - force logging to stdout when the value is true
LOG_STDOUT=false
5 changes: 4 additions & 1 deletion src/utils/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ function createBunyanLogger() {
},
];

if (process.env.NODE_ENV !== 'production') {
if (
process.env.NODE_ENV !== 'production' ||
process.env.LOG_STDOUT === 'true'
) {
// Adding logs to console in local machine and running tests
bunyanStreams.push({
stream: process.stdout,
Expand Down

0 comments on commit 0f06e0a

Please sign in to comment.