Closed mariosvlad closed 8 years ago
@rbaumier can you please share your way of configuring this package with the new version logentries? (I'm asking you since you submitted the #1. I stopped using logentries and am happy to give you owner permissions if you're interested in maintaining it.)
You can easily fix this by creating your own mapping upon instantiation:
{
levels: ['trace', 'debug', 'info', 'warn', 'error', 'fatal']
}
But because this is a bunyan based package, I think this should be standardised within the code.
I've done this in the above mentioned commit (of a fork of this package), but I also made some adjustments in style (standard
is now applied), so you could also easily copy in the above array and fix it that way
@boitewitte 's suggestion along with removing type: 'raw'
fixed my issue, so my code now looks like this:
var log = bunyan.createLogger({
name: "beta",
streams: [{
levels: ['trace', 'debug', 'info', 'warn', 'error', 'fatal'],
stream: bunyanLogentries.createStream({token: token})
}],
serializers: {
req: bunyan.stdSerializers.req,
res: bunyan.stdSerializers.res,
err: bunyan.stdSerializers.err
}
});
var my_logger = log.child({type: 'myCustomLogger'});
my_logger.error('error!!!');
my_logger.info('some info log');
can you please provide a more complete example or the changes required for 1.1 -> 1.2? my current code that works for 1.1 is something like this:
after upgrading to 1.2.0 i get the error
The log method was called with the unknown level "undefined"
, after reading the tests i assume i will have to send an object like this{msg: 'my log msg', level: 20}
but what function should i call (previously it was error, info,... ) if the level is already specified in the object? thanks in advance