Skip to content

[MDS-5437] keycloak log client #2777

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

Merged
merged 4 commits into from
Nov 3, 2023
Merged

Conversation

henryoforeh-dev
Copy link
Contributor

@henryoforeh-dev henryoforeh-dev commented Nov 3, 2023

Objective

MDS-5437

  • Added open telemetry package to get trace id and help with custom formatting.
  • Implemented logging attributes to include the following:
    • Timestamp=asctime
    • Level=levelname
    • Package name=name
    • Keycloak Client ID=audience
    • Filename: Line No=lineno
    • OTEL Trace ID=traceid
    • Message=message

Sample Output

image

formatted_message = super().format(record)

# Add the traceid, keycloak client id and message to the formatted log message
formatted_message = f'{formatted_message} [trace_id={traceid} client={KEY_CLOAK_CLIENT_ID}]: {record.message}'
Copy link
Collaborator

Choose a reason for hiding this comment

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

🙌🏻

Copy link
Collaborator

@matbusby-fw matbusby-fw left a comment

Choose a reason for hiding this comment

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

🚀

@henryoforeh-dev henryoforeh-dev merged commit 6fbc584 into develop Nov 3, 2023
@henryoforeh-dev henryoforeh-dev deleted the MDS-5437-keycloak-log-client branch November 3, 2023 17:12
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