Skip to content

Comments

fix(logger): format mfas in accordance to logflare, put level in meta#667

Merged
v0idpwn merged 2 commits intomainfrom
fix/logging
Jun 19, 2025
Merged

fix(logger): format mfas in accordance to logflare, put level in meta#667
v0idpwn merged 2 commits intomainfrom
fix/logging

Conversation

@v0idpwn
Copy link
Member

@v0idpwn v0idpwn commented Jun 18, 2025

What kind of change does this PR introduce?

Changes file log formatting to conform to Logflare's format.

What is the current behavior?

Because MFAs have a mix of strings and integers, ingestion fails. Also, the log level is on top level, but logflare expects it to be inside metadata, so it wouldn't get picked up.

What is the new behavior?

Added a pass to perform arbitrary transformations.

Additional context

Tested in staging

@v0idpwn v0idpwn requested a review from a team as a code owner June 18, 2025 19:22
@impl true
def format(%{msg: msg, level: level, meta: meta}, opts) do
context_keys = [Map.get(opts, :context, []) | @default_context]
context_keys = Map.get(opts, :context, []) ++ @default_context
Copy link
Member Author

Choose a reason for hiding this comment

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

This was also broken, the keys went outside of context because the list wasn't properly merged

@v0idpwn v0idpwn merged commit 6c79e9e into main Jun 19, 2025
13 of 15 checks passed
@v0idpwn v0idpwn deleted the fix/logging branch June 19, 2025 15:17
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.

2 participants