Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Jan 31 2019 15:14
    indexzero commented #1498
  • Jan 31 2019 15:13
    indexzero commented #1498
  • Jan 31 2019 15:04
    kbirger commented #1498
  • Jan 31 2019 13:01
    indexzero commented #1591
  • Jan 31 2019 13:01
    indexzero closed #1591
  • Jan 31 2019 12:59
    papandreou commented #1591
  • Jan 31 2019 10:41
    papandreou commented #1591
  • Jan 31 2019 10:40
    kibertoad commented #1591
  • Jan 31 2019 09:50
    papandreou opened #1591
  • Jan 30 2019 23:01
    DanielRuf opened #1590
  • Jan 30 2019 16:33
    ahce edited #1588
  • Jan 30 2019 16:32
    ahce closed #1587
  • Jan 30 2019 16:32
    ahce commented #1587
  • Jan 30 2019 15:29
    ColinMorris83 commented #1577
  • Jan 30 2019 15:07
    indexzero commented #1577
  • Jan 30 2019 14:56
    ColinMorris83 commented #1577
  • Jan 30 2019 14:33
    sapsaldog commented #1501
  • Jan 30 2019 14:30
    kibertoad commented #1501
  • Jan 30 2019 14:29
    sapsaldog commented #1501
  • Jan 30 2019 14:28
    kibertoad commented #1577
Fermin Hudson
hey guys, was wondering.. if I want to use child-logger capability (e.g. for requestId logging through-out the processing pipeline) but don't have to pollute all of the functions with an extra parameter.. does nodejs have a solution for this? how do you guys handle it?
I attempted to get started working on a project, I confirmed it is running winston@3.2.1 and currently still seeing TypeError: Cannot read property 'simple' of undefined referencing winston.format.simple()... Google tells me plenty of people were seeing this error following the wrong version of the docs on the v2.x version of winston. npm ls winston confirms I am runnning 3.2.1 - Any thoughts? please and thanks
Wilson López
What do I need to do to be able to send "defaultMeta" to the logs ?
Please help !
    level: 'info',
    format: format.combine(
        format: 'YYYY-MM-DD HH:mm:ss',
      format.errors({ stack: true }),
    defaultMeta: {
      name: process.env.npm_package_name,
      version: process.env.npm_package_version,
      environment: process.env.ENVIRONMENT,
    transports: [new transports.File({ filename: 'winston.log' })],
      new transports.Console({
        format: format.combine(format.colorize(), format.simple()),
Wilson López
@ethanrubio were you able to print defaultMeta to the logs ?
Wilson López
Solved, it only prints defaultMeta when I use logger.error
Stephen Hendricks
anyone know where the documentation regarding the format.errors() is? for such an extensive lib i feel like the documentation is lacking a lot
@wlopez-cl where did you learn what format.errors({ stack: true }) does? I am not able to find the information on this
Stephen Hendricks
my testing the {stack: true} does absolutely nothing to the log result
even setting it to false changes nothing
Adam Lee
Is winstond still the preferred http transport endpoint?
Looks pretty outdated.
Adam Lee
Spun up my own http server and hooked a Winston logger into the requests - pretty easy.
Jonas Ulrich

Hey everyone. Short question regarding the possibility of hooking into events related to logging messages:
Is there a way to register a handler function somewhere, which will be called for every 'logging'-event? Found some references to such an event on StackOverflow, but was completely unable to get code to run that actually works.

I see there's an _onEvent handler function theoretically bubbling up events from transports to the logger, but only error and warn seem to be passing through that.

Jonas Ulrich
I think I figured it out! It's the 'data' event, as per Nodes Transform Stream documentation, which is in use here with objectMode :thumbsup:
hello, does anyone import daily-rotate-logger-file package and see this error Uncaught TypeError: Cannot set property 'DailyRotateFile' of undefined?
Mohamed El Sayad (Anubis)
Hey everyone, I tried to help by define a new way to configure winston using .json file, please check https://www.npmjs.com/package/winston-sugar
Thomas Chiantia
Is everybody installing winston by using github master? Is there something going on with a release?
For context I am using typescript and there seems to be a lot of typescript fixes that arent published...
Thomas Chiantia
Shankar Singh
@here anyone facing this multiple callback issue?? with latest version??
NodeError: Callback called multiple times
File "<WORKSPACE>/node_modules/readable-stream/lib/_stream_transform.js", line 82, col 31, in DerivedLogger.afterTransform
return this.emit('error', new ERR_MULTIPLE_CALLBACK());
File "<WORKSPACE>/node_modules/winston/lib/winston/logger.js", line 310, col 7, in DerivedLogger._transform
File "<WORKSPACE>/node_modules/readable-stream/lib/_stream_transform.js", line 177, col 10, in DerivedLogger.Transform._read
this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
File "<WORKSPACE>/node_modules/readable-stream/lib/_stream_transform.js", line 164, col 83, in DerivedLogger.Transform._write
if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
File "<WORKSPACE>/node_modules/readable-stream/lib/_stream_writable.js", line 409, col 139, in doWrite
{snip} new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
File "<WORKSPACE>/node_modules/readable-stream/lib/_stream_writable.js", line 398, col 5, in writeOrBuffer
doWrite(stream, state, false, len, chunk, encoding, cb);
File "<WORKSPACE>/node_modules/readable-stream/lib/_stream_writable.js", line 307, col 11, in DerivedLogger.Writable.write
ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
File "<WORKSPACE>/node_modules/winston/lib/winston/logger.js", line 223, col 12, in DerivedLogger.log
this.write({ [LEVEL]: level, level, message: msg });
Any Workaround or stable version where it is fixed??
Hey-- how come the default winston transports don't log debug messages?
Or anything other than "info" and "error" types.
Richard Itimi

Hi, I've recently been getting this warning

(node:26105) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 unpipe listeners added to [File]. Use emitter.setMaxListeners() to increase limit
(node:26105) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [File]. Use emitter.setMaxListeners() to increase limit
(node:26105) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 drain listeners added to [File]. Use emitter.setMaxListeners() to increase limit
(node:26105) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [File]. Use emitter.setMaxListeners() to increase limit
(node:26105) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 finish listeners added to [File]. Use emitter.setMaxListeners() to increase limit
(node:26105) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 uncaughtException listeners added to [process]. Use emitter.setMaxListeners() to increase limit

I know there's been some discussions around this in the past, but couldn't find anything definitive in terms of a solution. I currently only use one winston logger instance across my application. I don't see this warning being logged to my log file, so I'm suspecting this might have something to do with the this.setMaxListeners(30) in the Console.js file

If you leave a page and come back you might be accidentally adding the same listener multiple times. I've used emitter.listeners in the past to view all listeners and find accidental duplicates.
Richard Itimi
How did you use the emitter.listeners precisely?
1 reply
Richard Itimi
Hey, I still need your help with the above issue. Thanks
Has anyone here still seen the "self._addDefaultMeta is not a function"error anymore?
I have been getting this VERY randomly. I am using the "winston": "3.2.1" and
"winston-daily-rotate-file": "3.10.0" on node 8.10.
Hi, I need some help configuring winston, would be cool if you could have a look at this: https://stackoverflow.com/questions/61525425/configuring-winston-logger
someone here
Collignon-Ducret Rémi
Matthew B White
Hello - the issue about the change to use git to pull a dependency is causing a quite a bit of stress; what's the current thinking on this issue?
Clemens E.
you would probably do that in the log function, where it says
"// Perform the writing to the remote service"
and after your request finished you call the callback

Hiya, I'm having some trouble migrating my project to Winston 3.0. I have my log levels set up so that I can use my logger with statements like logger.Info("log message"). This is what the working <3.0 logger looks like: https://gitlab.com/CodingKoopa/lionbot/-/blob/2cc1c07d8e6c6f5e2a71dbbceaf0231a945d22d6/Source/Logger.js.

Having migrated to 3.0, this is what it now looks like: https://hastebin.com/ukujojiwik.js. The issue that I'm having is that the log levels no longer seem to be working. With test code:

Logger.log(`Info`, `test`);

I get:

[winston] Unknown logger level: Info

TypeError: Logger.Info is not a function
Bedirhan Tuhana
Hello everyone. I'm logging but returning object. I just want message. How? Here is my createLogger config.
  transports: [
    new transports.Console()
  format: format.combine(
    format.colorize({ all: true }),
Bedirhan Tuhana
Lean Junio
Has anybody gotten this error? TypeError: this.format.transform is not a function
I'm just trying to use winston regularly
Jason Ish
When I console.log the info object passed into my printf formatter, I see the splat as [Symbol(splat)]: [ ... ]... How can I get at this object inside the info object..
Jakub Sochalec
hello, i'm new with winston package, i've looked trough docs but i didn't found what i was looking for, i want to place timestamp in front of logs (for example: "[timestamp] log entry") any idea how can i achieve that?
Carl-Clemens Ebinger
Hello, i use winston and winston-syslog in NestJS. What i miss, is a .info-method at the logger. Is the default log-level for .log-method 'info'? How do I log at log-level 'info'? Thank You. Best, ccebinger
hi. how do i make winston show date and time of a log
2 replies
hello? anyone there
Nils-Erik Frantzell
Hi all, is the team engaged here at all?