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

Enable JSON Formatting for Stdout/Stderr Logs with Customizable Schema #2337

Open
andreufontb opened this issue Dec 17, 2024 · 0 comments
Open

Comments

@andreufontb
Copy link

Description

Summary

In Kubernetes environments, it’s a common practice to use a centralized log collector to gather logs from the stdout and stderr streams of all pods. These logs are typically parsed and stored in a database (e.g., Elasticsearch) for further analysis.

To streamline this process, having all logs in JSON format would offer significant advantages:

  1. Simplified Parsing: JSON logs eliminate the need for pod-specific parsers, reducing complexity and configuration overhead.
  2. Standardized Logging: A unified format ensures consistency across all pods, making it easier to analyze and correlate logs.
  3. Customizable Fields: The ability to define custom JSON schemas would enable users to tailor log formats to their specific needs, ensuring all logs have consistent and meaningful fields.

Proposal

  • Provide an option to enable JSON formatting for stdout and stderr logs.
  • Allow customization of the JSON schema (e.g., define specific fields like timestamp, log_level, message, etc.).

Benefits

  • Improved Observability: Consistent, JSON-formatted logs facilitate easier integration with log collectors and analysis tools.
  • Operational Efficiency: Reduces the time and effort required to configure and maintain log parsing pipelines.
  • Flexibility: A customizable schema enables organizations to standardize their logging practices according to their requirements. like using ECS schema.

This feature would greatly enhance the logging capabilities in Kubernetes and improve interoperability with existing logging ecosystems.

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

No branches or pull requests

1 participant