log4js-node
log4js-node copied to clipboard
"TypeError: Cannot convert object to primitive value" in cluster mode
When I try to print the axios error in cluster mode, it failed with error TypeError: Cannot convert object to primitive value in the worker process.
code to reproduce this issue:
var axios = require('axios')
var cluster = require('node:cluster');
var log4js = require('log4js')
var logger = log4js.getLogger();
logger.level = "debug";
if (cluster.isPrimary) {
cluster.fork();
} else {
axios.get('http://local01host')
.catch(err => {
logger.error(err);
});
}
nodejs version: v21.5.0, axios and log4js are the latest version.