Skip to content

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

Closed
wants to merge 5 commits into from

Conversation

kazariad
Copy link

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

@vy vy self-assigned this Mar 13, 2025
@vy vy added the layouts Affects one or more Layout plugins label Mar 13, 2025
Copy link
Contributor

@ppkarwasz ppkarwasz left a comment

Choose a reason for hiding this comment

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

@kazariad,

In general this looks fine to me, thanks!
A couple of notes:

Copy link

github-actions bot commented Mar 14, 2025

Job Requested goals Build Tool Version Build Outcome Build Scan®
build-macos-latest clean install 3.9.8 Build Scan PUBLISHED
build-ubuntu-latest clean install 3.9.8 Build Scan PUBLISHED
build-windows-latest clean install 3.9.8 Build Scan PUBLISHED
Generated by gradle/develocity-actions

@kazariad
Copy link
Author

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.

@vy
Copy link
Member

vy commented Mar 21, 2025

@kazariad, I internally discussed this issue with @ppkarwasz, and we decided to not proceed with this PR due to following reasons:

  1. Putting aside your changes, UUID Pattern Converter is not in its ideal shape. The way it uses properties to pass temporal state, branches at runtime on UuidPatternConverter::isRandom, etc. needs to be improved. Further, with some minor effort, it can even be made garbage-free.
  2. I'm against copy-pasting a full-blown hashing algorithm – this is error prone and can pose security risks if used unwisely. In short, it is a liability that I prefer to avoid.
  3. There is more to this issue than it appears and, as the only active maintainers, @ppkarwasz and I would rather be busy with other more pressing issues.

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.

@vy vy closed this Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
layouts Affects one or more Layout plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants