datalust / pino-seq

A stream to send Pino events to Seq
Apache License 2.0
11 stars 10 forks source link

pino-seq does not log errors along with an object #1

Closed omidkrad closed 4 years ago

omidkrad commented 5 years ago

Since pino-seq does not have issues section I'm submitting this issue here. The project owner of pino-seq is @simihartstein.

Please see comments below:

import pino from 'pino';
import pinoToSeq from 'pino-seq';
const seqStream = pinoToSeq.createStream({
  serverUrl: 'http://localhost:5341',
});

const log = pino({ level: 'info'}, seqStream);
const err = new Error('Some error occurred.');

log.error(err); // works OK, but can't add additional meta data

log.error({ err }); // does not log any error info

log.error({ err, meta: 'aaa' }); // does not log any error info, only adds meta

// The only way I found to log error info with additional meta data is this:
log.error({ stack: err.stack, type: err.name, meta: 'aaa' }, err.message);

Note that the log.error({ err }) syntax is recommended by pino author but it doesn't work with pino-seq. This could be related to an issue with seq-logging that is used by pino-seq.

nblumhardt commented 5 years ago

Thanks for raising this. We're working with the current maintainer to move this package forwards.

nblumhardt commented 4 years ago

Transferred to the new datalust/pino-seq repository.

larenelg commented 4 years ago

Fixed in #2 :)

SquareLi commented 1 month ago

This is still an issue in build 9.4.0

nblumhardt commented 1 month ago

@SquareLi thanks for the note. The current package version is 1.2.0 so the build number you mention might be of Pino itself. Since this was resolved long ago, it's likely the details and causes of a similar issue now will be different - a new ticket with an example of what you're logging, what you get in Seq, and what is expected, is needed for us to track this down. Thanks!