Skip to content

Change loggers to add infos not in context but as arguments. #133

Closed

Description

@lerenn

For now, the loggers uses additional information from context, but doing a custom logger makes it hard to get those info as each one should be unwrapped from the context.

So we should make it explicitly passed by argument in the generated code and remove the context embedding in loggers (not in the generated code though).

Activity

  1. self-assigned this
    on Feb 21, 2024
  2. removed their assignment
    on Mar 11, 2024
  3. lerenn commented on Jun 12, 2026

    @lerenn
    OwnerAuthor

    PR #331 adds extensions.LogInfosFromContext so custom loggers can pull all the controller's contextual values (channel, correlation ID, direction, …) in a single call, addressing the immediate pain of unwrapping each context key manually.

    The remaining part of this issue — having the generated code pass this information as explicit LogInfo arguments and dropping the context enrichment from the built-in loggers — is a breaking, repo-wide change (it alters every generated log call and the built-in loggers' output sourcing). Leaving this issue open to track that larger refactor.

  4. lerenn commented on Jun 12, 2026

    @lerenn
    OwnerAuthor

    The custom-logger pain shipped in #331: extensions.LogInfosFromContext lets a custom logger pull all the controller's contextual values (channel, correlation ID, direction, …) out of the context in one call.

    The remaining (breaking) refactor — having the generated code pass these as explicit LogInfo arguments and dropping context enrichment from the built-in loggers — is tracked in #334. Closing this issue in favor of that focused follow-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions