getndazn / dazn-lambda-powertools

Powertools (logger, HTTP client, AWS clients, middlewares, patterns) for Lambda functions.
https://getndazn.github.io/dazn-lambda-powertools
MIT License
740 stars 77 forks source link

Option for lighter logging #236

Open richardtapendium opened 4 years ago

richardtapendium commented 4 years ago

This is a Feature Proposal

Description

Would it be possible to have an option to make the logging lighter on the lambda-powertools-logger?

Currently, every single call to Log.method logs out awsRegion, functionName etc. We would like to be able to log this data only on the first log of a function (usually the event data) and then turn it off for the rest. This would make it much easier to parse our logs.

If this is something the team is open to, I'd be happy to make the PR.

richardtapendium commented 4 years ago

It would also be helpful if we were able to log strings, e.g. screenshot below (truncated) image

When we view our logs in our logging service, instead of being able to see the string text directly, we now have to expand each object only to find a simple string that is decorated with a tonne of extra data, making it harder to find the exact log image

Would be great to have an option to just log strings too.

richardtapendium commented 4 years ago

@theburningmonk any opinion on this?