Use log.level if exists, translate stream to level, display level as col

This commit is contained in:
Erki Aas 2022-11-09 12:02:39 +02:00
parent 14d35c7ec3
commit 09e732f78e
2 changed files with 10 additions and 1 deletions

View File

@ -52,7 +52,7 @@ const config = {
width: 500,
},
{
field: 'stream',
field: 'level',
},
],
}

View File

@ -12,6 +12,15 @@ const parseEventData = (eventData) => {
if (message) {
json.message = message
}
let level;
if (json.log && json.log.level) {
level = json.log.level
} else if (json.stream) {
level = json.stream === 'stderr' ? 'error' : 'info'
}
if (level) {
json.level = level
}
return json
} catch (e) {
console.error(e, eventData)