-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Deterministic UUID option for PatternLayout #3532
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general this looks fine to me, thanks!
A couple of notes:
log4j-core/src/main/java/org/apache/logging/log4j/core/util/UuidUtil.java
Outdated
Show resolved
Hide resolved
log4j-core/src/main/java/org/apache/logging/log4j/core/util/UuidUtil.java
Outdated
Show resolved
Hide resolved
log4j-core/src/main/java/org/apache/logging/log4j/core/util/UuidUtil.java
Outdated
Show resolved
Hide resolved
Thanks for your feedback, @ppkarwasz. I was originally using a SecureRandom to comply with the UUID guidelines for using crypto-secure RNG, but I've experimented and decided to switch to a straightforward murmurhash of the LogEvent fields instead. It's also formatted as a UUID v8 now. |
@kazariad, I internally discussed this issue with @ppkarwasz, and we decided to not proceed with this PR due to following reasons:
In our earlier discussion, @ppkarwasz and I pointed you several potential paths. If you decide to go that route, and publish the code yourself (or your organization), then we would be happy to refer to your project and its Maven artifacts in our official documentation. |
Draft implementation of a deterministic UUID generator based on a LogEvent hash. Would enable Appenders to produce repeatable UUIDs for the same LogEvent and correlate log outputs.
Discussion