I have an issue with the logs on Cloud Watch. I keep having the logs on different entries instead of one single entry per log. Here's an example.
Output in the console:
[2020-12-21T11:51:21.966] [ERROR] default - [handlerProcess] [
ValidationError {
target: OnBroadcastStart {
broadcast_id: 'bro_...',
session_id: null,
timestamp: '2020-12-21T11:51:21.920Z'
},
value: null,
property: 'session_id',
children: [],
constraints: {
isNotEmpty: 'session_id should not be empty',
isString: 'session_id must be a string'
}
}
]
This is the output from a single error log.
Output in cloud watch:
[2020-12-21T11:51:21.966] [ERROR] default - [handlerProcess] [
[2020-12-21T11:51:21.966] ValidationError {
[2020-12-21T11:51:21.966] target: OnBroadcastStart {
[2020-12-21T11:51:21.966] broadcast_id: 'bro_...',
[2020-12-21T11:51:21.966] session_id: null,
[2020-12-21T11:51:21.966] timestamp: '2020-12-21T11:51:21.920Z'
[2020-12-21T11:51:21.966] },
[2020-12-21T11:51:21.966] value: null,
[2020-12-21T11:51:21.966] property: 'session_id',
[2020-12-21T11:51:21.966] children: [],
[2020-12-21T11:51:21.966] constraints: {
[2020-12-21T11:51:21.966] isNotEmpty: 'session_id should not be empty',
[2020-12-21T11:51:21.966] isString: 'session_id must be a string'
[2020-12-21T11:51:21.966] }
[2020-12-21T11:51:21.966] }
[2020-12-21T11:51:21.966] ]
Every single line is an entry here.
Is there any way to fix this? As logger for the project I'm using Log4js.