0

Can anyone suggest how to configure log4js in protractor config. When i use

var log4js = require('log4js');var logger = log4js.getLogger();

im able to print the logs in the console. But i want to configure the log4js to get the logs to a file.

S Pat
  • 409
  • 4
  • 15

1 Answers1

0

Please see this link

  1. install log4j with npm
  2. configure in conf.js - appender section
  3. declare in main.js / main entry of program
  4. add logging in scripts

    var log4js = require('log4js');

    log4js.loadAppender('file'); log4js.addAppender(log4js.appenders.file('data.log'), 'logs'); var logger = log4js.getLogger('logs'); logger.info('Started testcases ');

http://247knowledge.blogspot.in/2014/07/logger-in-protractor-e2e-testing.html