#360 allow to set log level

This commit is contained in:
Jan Prochazka
2023-01-22 10:55:10 +01:00
parent 1cf02488b4
commit 7eb6357c8d
2 changed files with 19 additions and 2 deletions

View File

@@ -20,9 +20,13 @@ function configureLogger() {
let logger = pinoms({
streams: [
{ stream: process.stdout }, // an "info" level destination stream
{
stream: process.stdout,
level: process.env.CONSOLE_LOG_LEVEL || process.env.LOG_LEVEL || 'info',
},
{
stream: fs.createWriteStream(logsFilePath),
level: process.env.FILE_LOG_LEVEL || process.env.LOG_LEVEL || 'info',
},
],
});