Questions tagged [log4js-node]

log4js-node is a logging framework for Node.js. (Not to be confused with log4js, since log4js-node is a different software.)

log4js-node is a conversion of the log4js framework to work with node.

121 questions
0
votes
1 answer

how cancel log4js input color flag to logfiles?

My Log4js configure | based node.js layout: { type: 'pattern', pattern: '%d - %m%n' } I user this method to record log var duration = new Date() - t; logger.info('Started', req.method, req.url, req.ip); …
Lee.zm
  • 105
  • 1
  • 12
0
votes
1 answer

How to call class method with variable args

I am creating a few NPM modules, which will be used in other modules of my large project. My main project configures and uses log4js NPM to do the logging. I also need to write some logs within the NPM modules for debugging / informational…
Mopparthy Ravindranath
  • 3,014
  • 6
  • 41
  • 78
0
votes
1 answer

Problems with loggers module definition in ExpressJS

I have my nodejs project, and I want to separate loggers from my route.js to have a clean code. But I have the next problem, when I try to load my logger to the route.js file, it shows me the next error: TypeError: loggers.getTicketLogger is not a…
Ismael Moral
  • 722
  • 1
  • 9
  • 35
0
votes
1 answer

What is the Unit of Measurement Used for the "maxLogSize" used in log4js Configuration File?

In the docs of log4js for creating a config file: { "appenders": [ { "type": "file", "filename": "relative/path/to/log_file.log", "maxLogSize": 20480, /* Unit ?? */ "backups": 3, "category": "relative-logger" …
leonard.javiniar
  • 539
  • 8
  • 25
0
votes
1 answer

Javascript logging setup for unit testing and running browser based web app

I am working on a client side only javascript web app. I am using log4javascript for logging application functionality while running on a local server and becuase I couldn't get log4javascript to work during unit testing (in either Jasmine+Karma or…
Don Smythe
  • 9,234
  • 14
  • 62
  • 105
0
votes
1 answer

How can I control how many days are rolled in 'dateFile' appender with the default '-yyyy-MM-dd' pattern?

Is there an option to control the maximum number days to roll? At first I thought this was controlled by the "backups" option, but a quick look at RollingFileStream.js seems to indicate that this manages indexes, not necessarily related to the date…
HiDefLoLife
  • 555
  • 1
  • 8
  • 28
0
votes
0 answers

Configurable rolling log file name

I am using log4js to log in my node js application. I have configured logger to create a log file when the file size reaches certain max size. The logger creates a file with same filename and '.' and index number is appended to the file name where…
Viddesh
  • 441
  • 5
  • 18
0
votes
1 answer

How to configure log4js in protractor

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
0
votes
2 answers

log4js-node in nodejs not logging to file

Not a node expert, and this is the first time I'm using log4js-node. I am trying to get my ERROR logs and any of my console logs to write to a log_file.log file with log4js on a nodejs server running Express. Here is my config file:` { …
adamgedney
  • 81
  • 1
  • 10
0
votes
1 answer

Can log4js-node run in a karma-browserify set up?

I am trying to learn Node test-driven frameworks. I figured I should include a logging system, but can't seem to get it to work. yourself@BDD0:~/BDD/simplest$ npm run test-browser > simplest@1.0.0 test-browser /home/yourself/BDD/simplest >…
Martin Bramwell
  • 2,003
  • 2
  • 19
  • 35
0
votes
2 answers

Username in logs with timestamp using log4js-node

I am using log4js-node for logs in application. Now what I want is to print the name of user logged in with the time stamp in logs. In java using log4j this could be done using MDC by exporting it and using as: MDC.put("user",xyz); How can this be…
Vaibhav Magon
  • 1,453
  • 1
  • 13
  • 29
0
votes
1 answer

Issue on log4js File Appender

I am using Log4js Library to print the log message in a file. In that I am getting 2 issues. Such as: 12:00:40 PM ERROR Log4js - TypeError: netscape.security.PrivilegeManager is undefined in Non-IE Browser. Please tell me how to fix this…
SKC...
  • 223
  • 3
  • 7
  • 15
-1
votes
1 answer

How to handle logging in cross-browser testing in Protractor?

I was building an automation framework with javascript(VanillaJS), jasmine, and protractor. I chose the log4js with log4js-protractor-appender for the logging. I try to save logs(by browser type) when I perform cross-browser testing. I wanted to run…
Orozbek Askarov
  • 126
  • 1
  • 9
-1
votes
1 answer

How to log Protractor exception to log files?

Currently I am able to write test execution statements to log files using log4js and log4js-protractor-appender-file npm modules. However, if any Protractor test case fails, that exception (like element not found, script timeout, assertion errors)…
-1
votes
2 answers

How do I redirect STDOUT to .json for logs in NodeJS

I need to have my logs in .json format and currently I use express-js server and my logs looks the following: Error: Cannot return null for non-nullable field Query.get_bar. Error: Cannot return null for non-nullable field Query.get_bar. Error:…
A. Karnaval
  • 727
  • 2
  • 8
  • 12
1 2 3
8
9