-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use different logger to make sure heartbeat is enabled
- Loading branch information
Showing
3 changed files
with
24 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { createLogger } from '@api3/commons'; | ||
|
||
import { loadEnv } from '../validation/env'; | ||
|
||
// We need to load the environment variables before we can use the logger. Because we want the logger to always be | ||
// available, we load the environment variables as a side effect during the module import. | ||
const env = loadEnv(); | ||
|
||
export const heartbeatLogger = createLogger({ | ||
colorize: env.LOG_COLORIZE, | ||
format: env.LOG_FORMAT, | ||
// We make sure the heartbeat logger is always enabled and logs all levels. | ||
enabled: true, | ||
minLevel: 'debug', | ||
}); |