Skip to content

Support for custom keys in the logs #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 3, 2020
Merged

Conversation

pankajagrawal16
Copy link
Contributor

This is suggestive implementation of supporting custom keys in structured log.

  • We exposed a API for clients to set custom keys
  • We maintain all the custom keys that client is willing to send as part of annotation. This gives a consolidated overview to clients as to what custom keys lambda might be logging.
  • It also prevents clients from passing custom keys via default ThreadContext APIs

Other option is that when client calls the exposed API method, we maintain those custom keys ourselves. Which is ok as and is up for discussion.

Reason for putting it at annotation level is that it gives nice overview of all the custom keys but many be its just additional overhead.

This is Up for discussion.

PS: I will write tests after we finalize the approach

@pankajagrawal16 pankajagrawal16 force-pushed the custom-key-support branch 2 times, most recently from f8b6c8b to 5dcd9a9 Compare July 31, 2020 12:08
Base automatically changed from support-for-event-logging to master July 31, 2020 12:48
@pankajagrawal16 pankajagrawal16 force-pushed the custom-key-support branch 6 times, most recently from 232f07d to 6f795de Compare July 31, 2020 13:09
@@ -14,7 +14,8 @@
import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyResponseEvent;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import software.aws.lambda.logging.PowerToolsLogging;
import software.aws.lambda.logging.client.PowerLogger;
import software.aws.lambda.logging.client.PowerToolsLogging;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain your thoughts behind the package move? I'm not sure what 'client' adds or means in this context

@pankajagrawal16 pankajagrawal16 merged commit 7efdbc0 into master Aug 3, 2020
@pankajagrawal16 pankajagrawal16 deleted the custom-key-support branch August 3, 2020 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants