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

Does log4js require any extra code to work on an Apache server?

I'm trying to add Log4js-Node to a Node.js server running on Apache. Here's my code: const path = require("path"); const express = require("express"); const log4js = require('log4js'); const app = express(); const logger =…
0
votes
1 answer

Application Insights logging with log4js in java

Azure application insights log messages using log4j framework in java as shown below. https://learn.microsoft.com/en-us/azure/azure-monitor/app/java-trace-logs Is there any similar thing for nodejs application without using using azure node sdk to…
Java P
  • 2,241
  • 6
  • 31
  • 45
0
votes
1 answer

Attach log file to email using sendgrid and node.js

I'm trying to send an email within a simple node.js application with the log file just created using log4js. I can send an email with sendgrid, and it has an attachment, but the attachment is empty. Any help would be appreciated. Here is the app.js…
Dan G.
  • 529
  • 8
  • 21
0
votes
1 answer

How to use log4js to send logs to elasticsearch?

I have a node app running as a server and trying to send logs to the remote elasticsearch. It looks like some syntax has been changed in the recent version of log4js. I tried one example from the link but it errors out. How to log from Node.js…
jtheg
  • 1
0
votes
1 answer

Log Session User NodeJs NestJs

I am trying to log the session user but its not working as i suspected. I was thinking i could add it in the middle ware but clearly this wont work. Is there a strategy or pattern i should be using to accomplish this. The PassportAuthInterceptor log…
Ricardo Saracino
  • 1,345
  • 2
  • 16
  • 37
0
votes
1 answer

Want to create new log file for each of the test case run in protractor

I am using an automation framework using protractor and javascript. We are using winston for logging .But with the configuration i have i am only able to create a single .log file which keeps appending. var winston =…
ashish chauhan
  • 353
  • 1
  • 3
  • 14
0
votes
0 answers

Debug Error with log4js appender when starting npm

When starting npm I am facing an error. The error states that "Error: log4js configuration problem for { type: 'log4js-syslog-appender'," Essentially seems like the format for the log4js config might be wrong. I am a complete newbie to node and…
JPK
  • 1
  • 2
0
votes
1 answer

logger.setLevel is not a function while running logger.js using log4js

I am trying to create logs files using log4js. While running node app.js after doing all the configurations i am getting the below error. Error: TypeError: logger.setLevel is not a function at Object.
Prathish
  • 61
  • 3
  • 10
0
votes
1 answer

Is it advisable to have 2 log4js running in nodejs application?

Is it advisable to have 2 log4js logging in my nodejs application. Logger A (The standard logger) to file A: Print out / Info Error Warning Logger B (Performance logger) to file B: Logs only performance (i.e. time taken to complete this…
shadow
  • 800
  • 2
  • 16
  • 33
0
votes
1 answer

Add dynamic value when writing log message with log4js

I want to add a dynamic attribute to a pattern I am using with log4js. I am using some custom pattern, something like this: "%d{} %-6p[%thread] %c [%x{context}]: %m%n%r" Context is the dynamic value that I want to set with some unique id generated…
Boltosaurus
  • 2,138
  • 3
  • 21
  • 33
0
votes
1 answer

error using log4js in node when pass request object for log

sorry for my english, im trying to uso log4js for set a log on the api calls in express, im stuck with this, when try to log the patition. http_outgoing.js:503 throw new errors.Error('ERR_HTTP_HEADERS_SENT', 'set'); ^ Error…
Pablo
  • 90
  • 9
0
votes
1 answer

Will performance of a Node server be affected if I use my custom logger function instead of using libraries like winston or log4js?

I'm new to nodejs and I'm trying to create a function for custom formatted logging to file and console. Below is the function which I am using for this purpose. module.exports.log =function(req,res) { res.on('finish', function() { point = new…
JPK
  • 95
  • 1
  • 8
0
votes
1 answer

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

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…
Kushal Bhalaik
  • 3,349
  • 5
  • 23
  • 46
0
votes
1 answer

In Log4js how do you enable tracing?

In the documentation I could find for Log4js, there is a function isTraceEnabled(), which is defined as isTraceEnabled checks if Level Trace is enabled However, I can't find anywhere how do you actually enable (not check) this trace level. How can…
KansaiRobot
  • 7,564
  • 11
  • 71
  • 150
0
votes
0 answers

log4js not recognized by intelliSense of VisualStudio 2017

My NodeJS project is written in Typescript 2.5 The following import line for the module: import log4js= require('log4js); compiles and i use the logger successfully. Even IntelliSense prompts the object method and properties well. Yet, i got…
MiguelSlv
  • 14,067
  • 15
  • 102
  • 169
1 2 3
8 9