Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 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
David Hyde
@DABH
Why would you need a lot of loggers? To have different default metadata objects? You could try using child loggers for that? However, personally I’d try to use one logger and have a custom formatter do the heavy lifting / inserting custom stuff into my log messages. Not sure of the details of your use case though
Ahmet Çevik
@ahmetceviik
0|shard | TypeError: self._addDefaultMeta is not a function
0|shard | at pbotClient.DerivedLogger.(anonymous function) (/root/pbot/node_modules/winston/lib/winston/create-logger.js:80:14)
Why error?
Lean Junio
@leanjunio
Hey guys, idk if I'm missing anything but winston is not really logging anything, https://github.com/leanjunio/sequelize-practice/blob/master/index.js#L23, I used the example code from winston's docs
Sander Steenhuis
@Redsandro
Any winston-gitter-webhook module?
Fermin Hudson
@ferminhn87_twitter
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?
Joe
@josephjaniga
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
@wlopez-enkoding
What do I need to do to be able to send "defaultMeta" to the logs ?
Please help !
createLogger({
    level: 'info',
    format: format.combine(
      format.timestamp({
        format: 'YYYY-MM-DD HH:mm:ss',
      }),
      format.errors({ stack: true }),
      format.splat(),
      format.json()
    ),
    defaultMeta: {
      name: process.env.npm_package_name,
      version: process.env.npm_package_version,
      environment: process.env.ENVIRONMENT,
    },
    transports: [new transports.File({ filename: 'winston.log' })],
  })
logger.add(
      new transports.Console({
        format: format.combine(format.colorize(), format.simple()),
      })
    )
Wilson López
@wlopez-enkoding
@ethanrubio were you able to print defaultMeta to the logs ?
Wilson López
@wlopez-enkoding
Solved, it only prints defaultMeta when I use logger.error
Stephen Hendricks
@z1haze
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
@z1haze
my testing the {stack: true} does absolutely nothing to the log result
even setting it to false changes nothing
Adam Lee
@adamlee-ARC
Is winstond still the preferred http transport endpoint?
Looks pretty outdated.
Adam Lee
@adamlee-ARC
Spun up my own http server and hooked a Winston logger into the requests - pretty easy.
Jonas Ulrich
@julrich

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
@julrich
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:
elinskytap
@elinskytap
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)
@melsayad
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
@TomzBench
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
@TomzBench
@indexzero
Shankar Singh
@Shankar-khati
@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
callback();
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??
nolan
@noolaan
Hey-- how come the default winston transports don't log debug messages?
Or anything other than "info" and "error" types.
Richard Itimi
@itimirichard

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

tagyoureit
@tagyoureit
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
@itimirichard
How did you use the emitter.listeners precisely?
1 reply
Richard Itimi
@itimirichard
Hey, I still need your help with the above issue. Thanks
Jared
@jaredjacob667
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.
F★
@storyofstella_twitter
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
luno
@luciano-nascimento
hi
someone here
Collignon-Ducret Rémi
@miton18
Yes
Matthew B White
@mbwhite
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.
@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
@LiSa20120
Koopa
@CodingKoopa_gitlab

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`);
Logger.Info(`test`);

I get:

[winston] Unknown logger level: Info
Server.js:13
Logger.Info(`test`);
       ^

TypeError: Logger.Info is not a function
Bedirhan Tuhana
@v30xy
Hello everyone. I'm logging but returning object. I just want message. How? Here is my createLogger config.
createLogger({
  transports: [
    new transports.Console()
  ],
  format: format.combine(
    format.colorize({ all: true }),
    format.simple()
  )
});
Bedirhan Tuhana
@v30xy
thanks
Lean Junio
@leanjunio
Has anybody gotten this error? TypeError: this.format.transform is not a function
I'm just trying to use winston regularly
Jason Ish
@jasonish
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..