我对 Cloud Watch 上的日志有疑问。我一直将日志记录在不同的条目上,而不是每个日志一个条目。这是一个例子。
控制台中的输出:
[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.
云手表中的输出:
[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] ]
每一行都是这里的一个条目。
有没有什么办法解决这一问题?作为项目的记录器,我正在使用 Log4js。