Questions tagged [winston]

Node.js now offers a cutting-edge logging solution that supports multiple transports and operates asynchronously.

Error in Winston: Unable to determine the length of undefined property

I encountered an issue with my Winston Transport in the express backend of my MERN app. The error message reads: error: uncaughtException: Cannot read property 'length' of undefined TypeError: Cannot read property 'length' of undefined at DerivedLo ...

Utilize the Winston Node logger to save JSON logs with date and time formatting

Currently, I am attempting to use winston to log json data while including a timestamp. Below is my current configuration: 'use strict'; import * as winston from 'winston'; const LOG = !!process.env.LOG; export const { error, info, ...

Error Unhandled in Node.js Application

I have encountered an issue in my NodeJS application where I have unhandled code in the data layer connecting to the database. I deliberately generate an error in the code but do not catch it. Here is an example: AdminRoleData.prototype.getRoleByRoleId = ...

Uncover the solution to eliminating webpack warnings associated with incorporating the winston logger by utilizing the ContextReplacementPlugin

When running webpack on a project that includes the winston package, several warnings are generated. This is because webpack automatically includes non-javascript files due to a lazy-loading mechanism in a dependency called logform. The issue arises when ...

configure Winston to record the URL pathway within an Express application

I recently implemented a winston logger for the first time. const { createLogger, format, transports } = require('winston'); const logLevels = { error: 0, warn: 1, info: 2, verbose: 3, debug: 4, silly: 5 }; const logger = createLogger({ level: logLe ...

Transforming all commas to plus signs in a JavaScript codebase for the entirety of

Currently, I am using winston for logging and have created a common method to log throughout the project. However, I am facing an issue with many logging statements that look like this: logger.info("here is the data" , data) The problem arises when trying ...

winston is experiencing difficulty in saving the console message to a file

I am interested in using Winston to log all Console messages, and implementing winston-daily-rotate-file to store and delete logs on a daily basis. When looking at the Console: {"level":"info","message":"Feathers applica ...

Issue with using custom SQL queries in Winston with PostgreSQL and a specific table name

const logger = new (winston.Logger)({ transports : [ new winston.transports.PostgreSQL({ connString : 'xxxxxxxxxxx', schema : 'public', //tableName : 'logEntry', customSql:'INSERT INTO publ ...