Log4js配置错误

时间:2017-09-28 17:51:43

标签: javascript log4js-node

我正在尝试设置一个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)

1 个答案:

答案 0 :(得分:0)

您正在使用带有v0或v1 appender格式的Log4JS的v2.x.你的appender格式应该是这样的:

describe('Main.vue', () => {
  it('should render correct contents', () => {
    const vm = new Vue(Main).$mount()
    console.log(vm.$el)
    expect(vm.$el.querySelector('.hello h1').textContent).to.equal('Welcome to Your Vue.js App')
  })
})