Skip to content

RFC: Allow filtering logEvent output #66

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

Closed
dgomesbr opened this issue Sep 1, 2020 · 6 comments
Closed

RFC: Allow filtering logEvent output #66

dgomesbr opened this issue Sep 1, 2020 · 6 comments
Assignees
Labels
feature-request New feature or request

Comments

@dgomesbr
Copy link

dgomesbr commented Sep 1, 2020

Is your feature request related to a problem? Please describe.

It's not, it's an enhancement

Describe the solution you'd like

Considering that logEvent param exists over @PowertoolsLogging, we should provide an option include only/exclude fields from the event log record itself, as such:

  • AllowedFields: Set<...> Only log items contained on the List/Set
  • PreventLogFields: Set<...>: Only log items not matching the List/Set
    ....

Describe alternatives you've considered

There are no alternatives when using LogEvent

Additional context

@dgomesbr dgomesbr changed the title Filter logEvent output Allow filtering logEvent output Sep 1, 2020
@pankajagrawal16 pankajagrawal16 changed the title Allow filtering logEvent output RFC: Allow filtering logEvent output Sep 1, 2020
@pankajagrawal16 pankajagrawal16 added the feature-request New feature or request label Sep 1, 2020
@pankajagrawal16
Copy link
Contributor

Hey @dgomesbr It definitely sounds like an interesting idea.

Could you please shed some more inputs on your thoughts here ? Like What and how you think of it behaving on nested payload etc ?

@dgomesbr
Copy link
Author

dgomesbr commented Sep 1, 2020

@pankajagrawal16 as an user concerned with data being logged, but also conscious about logging, I would like to either pass a Predicate<? super String> predicate where users could pass whatever predicate they want, and maybe apply at PowertoolsLogger.java implementation level.

Does that adds up?

@msailes
Copy link
Contributor

msailes commented Sep 22, 2020

I was thinking about this. I think nested payloads makes this harder.

Could the user pass an implementation class name, we'd instantiate it and use it to do the filtering.

@pankajagrawal16
Copy link
Contributor

I have created a PR which will let clients override the default object mapper used for serializing the event. This will also let client decide and how and what they want to log the event. #287

@dgomesbr I believe we can close this issue based on this ability as well. Thoughts?

@dgomesbr
Copy link
Author

LGTM

@pankajagrawal16
Copy link
Contributor

Available in 1.3.0 now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants