KyleRoss / node-lambda-log

Basic logging mechanism for Node.js Lambda Functions and other AWS services, which produces logs in JSON format for easier reading through Cloudwatch Logs.
https://lambdalog.dev
MIT License
193 stars 16 forks source link

_logLevel and log tag seems repetitive #29

Closed tulsidas closed 3 years ago

tulsidas commented 4 years ago

On all the logs there is both _logLevel and the log tag, that seems repetitive in the sense that I'm having the same info twice (thrice, considering that AWS CloudWatch also adds the level), can this be customized to remove the log tag for example? I saw that it is hardcoded on the source code

{"_logLevel":"info","msg":"hiya","_tags":["log","info"]}

KyleRoss commented 4 years ago

@tulsidas I agree that it is repetitive and was added originally to allow for different methods of querying logs within CloudWatch. I will think through some options to make these default tags optional or overridable.

KyleRoss commented 3 years ago

@tulsidas This has been implemented and published in v3.0.0. I'm still waiting for the new documentation site to go live with the details.

In short, the default tags ["log", "LEVEL"] have been removed. In addition, you now have the ability to remove the _logLevel field from the message JSON as well.

Thanks for the idea!

KyleRoss commented 3 years ago

@all-contributors please add @tulsidas for ideas

allcontributors[bot] commented 3 years ago

@KyleRoss

I've put up a pull request to add @tulsidas! :tada:

tulsidas commented 3 years ago

yaaaaay! 💪