Skip to content
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

Provide alternate UnsafeArg factory that takes Supplier<T> #8

Open
gracew opened this issue Jun 5, 2017 · 1 comment
Open

Provide alternate UnsafeArg factory that takes Supplier<T> #8

gracew opened this issue Jun 5, 2017 · 1 comment

Comments

@gracew
Copy link
Contributor

gracew commented Jun 5, 2017

We may want to log an object with a sensitive field that should not be logged even under unsafe parameters (e.g. user credentials).

log.info("message", UnsafeArg.of("name", unsafeValue))

Rather than relying on the toString() implementation to remove the offending value, users should instead be able to write:

log.info("message", UnsafeArg.of("name", () -> removeUserCredentials(unsafeValue))

This mostly applies to UnsafeArg, but maybe we could also add to SafeArg for consistency. The more probable scenario with SafeArg is a field that is too large/expensive to log.

@gracew gracew changed the title Provide alternate UnsafeArg factory that take Supplier<T> Provide alternate UnsafeArg factory that takes Supplier<T> Jun 5, 2017
@schlosna
Copy link
Contributor

schlosna commented Jun 6, 2017

+1 to also adding to SafeArg for lazy evaluation for perf concerns as I've seen a few internally. Would also allow cleansing for safe logging portion of object.

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

No branches or pull requests

2 participants