我目前正在尝试设置一个csgo赌博网站作为乐趣,我在尝试运行bot.js时遇到了这个错误
Error: Problem with log4js configuration: ({ appenders:
[ { type: 'console' },
{ type: 'file', filename: 'logs/bot_undefined.log' } ] }) - must have a property "appenders" of type object.
at tests.forEach (/var/www/html/bot/node_modules/log4js/lib/configuration.js:44:15)
at Array.forEach (native)
at Configuration.throwExceptionIf (/var/www/html/bot/node_modules/log4js/lib/configuration.js:42:11)
at new Configuration (/var/www/html/bot/node_modules/log4js/lib/configuration.js:205:10)
at Object.configure (/var/www/html/bot/node_modules/log4js/lib/log4js.js:201:12)
at Object.<anonymous> (/var/www/html/bot/bot.js:18:8)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)发布于 2017-09-29 23:22:23
您正在使用具有v0或v1附加器格式的Log4JS v2.x。您的附加器格式应如下所示:
log4js.configure({
appenders: {
console: {
type: 'console'
},
logstash: {
host: '123.456.789.123',
port: 1234,
type: 'logstashUDP',
logType: 'myAppType', // Optional, defaults to 'category'
fields: { // Optional, will be added to the 'fields' object in logstash
field1: 'value1',
field2: 'value2'
},
layout: {
type: 'pattern',
pattern: '%m'
}
}
},
categories: {
default: { appenders: ['console', 'logstash'], level: 'trace' }
}
});https://stackoverflow.com/questions/46475464
复制相似问题