From 268619a651b480db21be4c877a191c55cb06340a Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Mon, 31 Jul 2017 21:07:35 +0900 Subject: [PATCH] Update example/common/utils_log.js to support log4js 2.3 --- example/common/utils_log.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/example/common/utils_log.js b/example/common/utils_log.js index bbeb34c1..5eff58ff 100755 --- a/example/common/utils_log.js +++ b/example/common/utils_log.js @@ -4,22 +4,25 @@ var log4js = require('log4js') // var path = require('path') function getLogger (category, level) { - var log if (level == null) { level = 'INFO' } log4js.configure({ - appenders: [ - { + appenders: { + console: { type: 'console' } - ] + }, + categories: { + default: { + appenders: ['console'], + level + } + } }) - log = log4js.getLogger(category) - log.setLevel(level) - return log + return log4js.getLogger(category) } function Log (filename, level) {