[英]Log4js Config Error
我目前正在嘗試設置一個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)
您正在使用v4或v1附加程序格式的Log4JSv2.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' }
}
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.