log4js-node

Getting error in setting up log4js-protractor-appender in protractor

廉价感情. 提交于 2019-12-24 22:07:22
问题 My Conf.js looks like below: // An example configuration file. exports.config = { directConnect: true, // Capabilities to be passed to the webdriver instance. capabilities: { 'browserName': 'chrome' }, // Framework to use. Jasmine is recommended. framework: 'jasmine', // Spec patterns are relative to the current working directory when // protractor is called. specs: ['test_spec1.js'], // Options to be passed to Jasmine. jasmineNodeOpts: { defaultTimeoutInterval: 30000 }, var log4js = require(

Node js Syntax error unexpected token?

女生的网名这么多〃 提交于 2019-12-11 08:14:00
问题 Everything in my code and log4js file seems to be fine and syntactically correct. However, when running my app, I get this following error: undefined:1 ?{ ^ SyntaxError: Unexpected token ? It happens when I get to this line: var logFile = 'log4js_' + process.env.NODE_ENV + '.json'; log4js.configure(logFile); This is my log4js file { "appenders": [ { "type": "console" }, { "type": "file", "filename": "logs/main.log", "maxLogSize": 1024000, "category": "main" } ] } I have no idea why it might

Error with log4js configuration: must have a property “appenders” of type object

让人想犯罪 __ 提交于 2019-12-11 04:59:23
问题 I am getting Error: Problem with log4js configuration: ({ appenders: [ { type: 'logLevelFilter', level: 'INFO', appenders: { type: 'console' } } ] }) - must have a property "appenders" of type object. My protractor.conf.js file snippet: beforeLaunch:function(){ log4js.configure({ appenders: [{ type: 'log4js-protractor-appender', category: 'protractorLog4js' }, { type: "file", filename: './logs/ExecutionLog.log', category: 'protractorLog4js' } ] }); }, I am not sure why i am getting this error

Log4js javascript create daily log file

佐手、 提交于 2019-12-02 05:36:23
问题 I have a project nodejs and use log4js to write log. I want create new file log when start new date. Example: daily.2017_07_31.log daily.2017_08_01.log daily.2017_08_02.log daily.2017_08_03.log In java, I know config log4j but in nodejs with log4js I don't know. Thank every body for your help :) 回答1: winston is recommended for nodejs. Its pretty easy to use. Create a logger.js file and have this configuration ' require('winston-daily-rotate-file'); var winston = require('winston'); winston