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
3
votes
1 answer

Is log4js library asynchronous?

I have small question to know whether log4js library is asynchronous. I tried to find the log4js document but no luck. I want to use this in my node js app's but before that i want to know is its asynchronous or not?
Sohan
  • 6,252
  • 5
  • 35
  • 56
3
votes
1 answer

How can I make log4js print objects like console.log does

I have a project that has JavaScript in 2 places. One is using node.js on the server-side while the other is obviously the browser JavaScript. I am required to support any browser and I'd like to have a single logging framework for all of them. I…
trixtur
  • 708
  • 6
  • 14
2
votes
0 answers

Log4js permission error when installing something with npm

I am learning web development and when I am installing tailwindcss using npm it throws this error: log4js <6.4.0 Severity: moderate Incorrect Default Permissions in log4js - https://github.com/advisories/GHSA-82v2-mx6x-wq7q No fix…
2
votes
1 answer

log4js is not working in node , How to configure it...?

I have installed log4js npm and try to implement logger to my node api... I am trying to use log4js for the first time. Code: var log4js = require('log4js'); // include log4js log4js.configure({ // configure to use all types in different files. …
Prabind
  • 21
  • 3
2
votes
0 answers

How to NOT overwrite current DateFile with log4js

Hello I have following log4js configuration: const defaultPath = './logs/notif.log' const defaultFormat = '"%d{yyyyMMddhhmmssSSS}","%p","%x{user}","%m"' module.exports = (level = 'debug', path = defaultPath, format = defaultFormat, compress = true)…
The Fool
  • 16,715
  • 5
  • 52
  • 86
2
votes
0 answers

Configure log4js logger to log only INFO to console and everything to file

With below-mentioned log4js configuration, I intend to log everything to a file in logs/test/log-timestamp.txt file and only INFO level to console, but I see that the console prints all the levels. How do I fix this? { "appenders": { …
Akshay Maldhure
  • 787
  • 2
  • 19
  • 38
2
votes
1 answer

How to print req.user.id in each log statement in node js using log4js

Currently, I am using express with log4js module like this, in any route file: var log = require('log4jslogger.js').LOG; log.info('this is log statement'); logger.js var log4js = require('log4js'); log4js.configure(__base +…
Yogesh
  • 21
  • 2
2
votes
1 answer

How to log the Console logs into the file using log4js

I want to log the console logs whether the expect failing or any exception coming into the log file. How can i do that without using try and catch. In LOG4j for java there is rootlogger which automatically logs all the system information logs into…
anuvrat singh
  • 411
  • 1
  • 7
  • 20
2
votes
0 answers

Configure fileName of log4js in RollingFileStream

I am using log4js to log in my node js application. I have configured logger to create a new 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
2
votes
1 answer

log4js https logging endpoint

In log4js is there any option to use HTTP endpoint for logging the information. Like in Winston you have HTTP transport for logging to remote HTTP endpoint by specifying host:port, is there something similar in log4js ?
Sohan
  • 6,252
  • 5
  • 35
  • 56
1
vote
1 answer

How to parse multiline json in Promtail

I am using log4js to log data to a file in my app. I want to display some of this data in my Grafana dashboard and for that I am using Promtail to read logs from the file, pre-process it and send it to Loki. In Loki, I want to filter the data based…
Max Zavodniuk
  • 79
  • 1
  • 7
1
vote
1 answer

Why do I receive 2 log files in log4js?

I have the following configuration of my logger in a Node.js script: const log4js = require('log4js'); log4js.configure({ appenders: { out: { type: "dateFile", filename: conf.logsFolder+"etl-processing.log", …
1
vote
0 answers

Using log4js with Vue 3

I want to add log4js to my Vue project. I created a logger.ts file wiht this code import log4js from "log4js"; log4js.configure({ appenders: { app: { type: "file", filename: "./logs/app.log", compress: true, …
betta7391
  • 103
  • 9
1
vote
1 answer

how can i install log4js in a react application?

this is a very simple question to which I am not able to find a simple answer: how can I implement log4js to run in a react app? I have tried to install the npm package https://www.npmjs.com/package/log4js But this one seems to be made to run in a…
julBayonna
  • 409
  • 7
  • 19
1
vote
1 answer

log4js-node with ES module?

I am trying to set up log4js-node in my code. As I want to write to the same log file from different .js files, I am setting it up in an external file as per the documentation: const appSettings = { log4js: { traceLogConfig: { …
Nimrod Yanai
  • 777
  • 2
  • 8
  • 30
1
2
3
8 9