chore: system logger with error stack (#3747)

This commit is contained in:
ChengLei Shao 2024-03-18 14:32:37 +08:00 committed by GitHub
parent aa1823cd73
commit a81fa5b8e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -49,11 +49,12 @@ class SystemLoggerTransport extends Transport {
}
log(info: any, callback: any) {
const { level, message, reqId, app, [SPLAT]: args } = info;
const { level, message, reqId, app, stack, [SPLAT]: args } = info;
const logger = level === 'error' && this.errorLogger ? this.errorLogger : this.logger;
const { module, submodule, method, ...meta } = args?.[0] || {};
logger.log({
level,
stack,
message,
meta,
module: module || info['module'] || '',