Skip to content

Fine-grained logging for PartitionFlow owned classes - #769

Open
fillson-shady wants to merge 2 commits into
masterfrom
vfilatov/fine-grained-logging
Open

Fine-grained logging for PartitionFlow owned classes#769
fillson-shady wants to merge 2 commits into
masterfrom
vfilatov/fine-grained-logging

Conversation

@fillson-shady

Copy link
Copy Markdown
Contributor

No description provided.


val acquire = Resource.eval {
for {
log <- logOf(classOf[TimerFlowOf[F]]).map(_.withMdc(Mdc.Eager("key" -> context.key)))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

how will this look in logs, could you give me an example please?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Based on a pattern used for the appender it's something like:

INFO  [io-compute-3][c.e.k.f.t.TimerFlowOf] [key=7ze4zp5t3ru61ff70a9] - Something happened

Of course we may use prefixed instead of withMdc as it was before.

@Z1kkurat

Copy link
Copy Markdown
Contributor

@fillson-shady shall we come back to this? I looked through this and I have no comments except for mentioning that a new major release will be in order since KeyStateOf and its methods are a part of the user API

@fillson-shady
fillson-shady force-pushed the vfilatov/fine-grained-logging branch 2 times, most recently from 2fd5b4d to 8ca7aa9 Compare June 2, 2026 13:14
…y in KeyContext, add topic-partition to MDC
@fillson-shady
fillson-shady force-pushed the vfilatov/fine-grained-logging branch from 8ca7aa9 to 1ec3a40 Compare June 2, 2026 13:14
@fillson-shady
fillson-shady marked this pull request as ready for review June 2, 2026 13:23
@fillson-shady

Copy link
Copy Markdown
Contributor Author

Hi @Z1kkurat, thank you for the remainder!
I revisited this MR and add a one more commit to address two things I spotted:

  • added topicPartition information to MDC since we have it currently
  • incapsulated MDC passing logic in KeyContext, so it still provides def log, but now it accepts a class argument, so the logger is instantiated with a proper name and provided with MDC
    Could you please re-review these changes?

As for the version - it's not a part of the codebase, right? We'll just create a tag 9.0.0 for the next release.

@stasimus

Copy link
Copy Markdown
Contributor

@Z1kkurat please release new version

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.

3 participants