Skip to content

Add high priority fields to beginning of JSON object when json format#322

Closed
Fire-Dragon-DoL wants to merge 1 commit intoreidmorrison:masterfrom
janetechinc:francesco/timestamp-level-message-first
Closed

Add high priority fields to beginning of JSON object when json format#322
Fire-Dragon-DoL wants to merge 1 commit intoreidmorrison:masterfrom
janetechinc:francesco/timestamp-level-message-first

Conversation

@Fire-Dragon-DoL
Copy link
Copy Markdown

@Fire-Dragon-DoL Fire-Dragon-DoL commented Aug 18, 2025

Issue # (if available)

N/A

Changelog

Pull requests will not be accepted without a description of this change under the [unreleased] section
in the file CHANGELOG.

Description of changes

This PR moves the timestamp, level, level_index and message to the beginning of the JSON object.
This was a request by our DevOps team so that in case something is wrong with the JSON output and something is being "mangled" at the end of the log line, it is possible to extract timestamp, level and message from the information using regex or in general, simple tools.

This change shouldn't break anything since order of JSON shouldn't matter for any programmatic tools, but it does change for humans.

Would you be open to this kind of change?

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@Fire-Dragon-DoL Fire-Dragon-DoL force-pushed the francesco/timestamp-level-message-first branch from af9b575 to f116a6d Compare August 18, 2025 20:53
Copy link
Copy Markdown

@imajes imajes left a comment

Choose a reason for hiding this comment

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

makes sense to me.

@reidmorrison
Copy link
Copy Markdown
Owner

Can you merge the latest master to resolve the conflicts and I will merge the PR?

@Fire-Dragon-DoL Fire-Dragon-DoL force-pushed the francesco/timestamp-level-message-first branch from f116a6d to 8997fb0 Compare December 10, 2025 00:10
@Fire-Dragon-DoL
Copy link
Copy Markdown
Author

Can you merge the latest master to resolve the conflicts and I will merge the PR?

Thank you @reidmorrison , I rebased on master, it is ready for merge

@Fire-Dragon-DoL
Copy link
Copy Markdown
Author

Hi @reidmorrison , any chance this could be merged? It's our main blocker in adopting semantic_logger right now. There is a workaround, but it's a lot more code than this, I'd love to keep the complexity low

@gstokkink
Copy link
Copy Markdown
Contributor

@Fire-Dragon-DoL I think it needs another rebase?

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.

4 participants