Skip to content
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

Add support for structured logging #21682

Open
sebastianbuechler opened this issue Jan 27, 2025 · 4 comments
Open

Add support for structured logging #21682

sebastianbuechler opened this issue Jan 27, 2025 · 4 comments
Labels
enhancement New feature or request

Comments

@sebastianbuechler
Copy link

Summary

Add support for properly displaying structured logging in the log section instead of simple strings.

Motivation

Most logging systems support structured logging due to the extensive amount of information that could be logged. Showing collapsible structured logs enhances the value of extensive logs.

Proposal

Detect if a log is valid json and then use a different renderer that will capture the structure of the log automatically. Similarly as GCP does it in Cloud Logging.

@sebastianbuechler sebastianbuechler added the enhancement New feature or request label Jan 27, 2025
@crenshaw-dev
Copy link
Member

Duplicate of #7550?

@sebastianbuechler
Copy link
Author

Duplicate of #7550?

Not quite. Although pretty printing the JSON object would already help a bit with long logging messages and the mentioned PR seems to be quite small.

What I had in mind is a more interactive UI for structured logs where the user can uncollapse on-demand without seeing all log fields at once. Structured logs can grow pretty large and finding the right field in a unformatted string or even a pretty printed JSON object thus can become tedious.

Also, adding the support for structured logs can open out new features for commonly used log events like API calls.

To summarize:
Current
Image
Proposed
Image

@crenshaw-dev
Copy link
Member

So if I understand correctly, the request is #7550 with the addition of:

  1. request to make JSON sections collapsible (probably collapsed by default)
  2. support for non-JSON structures

@sebastianbuechler
Copy link
Author

sebastianbuechler commented Jan 31, 2025

So if I understand correctly, the request is #7550 with the addition of:

  1. request to make JSON sections collapsible (probably collapsed by default)
  2. support for non-JSON structures

Yes. More or less add the functionality of https://www.npmjs.com/package/react-json-view if the log is in JSON format. Demo: https://mac-s-g.github.io/react-json-view/demo/dist/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants