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

Define Logging Levels and Use Cases #108

Open
5 tasks
danehans opened this issue Dec 17, 2024 · 1 comment
Open
5 tasks

Define Logging Levels and Use Cases #108

danehans opened this issue Dec 17, 2024 · 1 comment

Comments

@danehans
Copy link

Currently, the project lacks clearly defined conventions and guidelines for logging. This creates potential inconsistencies in how logging is implemented across the codebase. Establishing standard practices for logging will improve code maintainability, debugging, and user experience.

  1. Define Logging Levels and Their Use Cases:

    • Provide clear definitions and examples for log levels (e.g., DEBUG, INFO, WARN, ERROR, FATAL).
    • Specify when to use each level, such as:
      • DEBUG: Detailed diagnostic information, disabled in production.
      • INFO: High-level status updates for normal operations.
      • WARN: Indication of potential issues or recoverable errors.
      • ERROR: Non-recoverable errors requiring attention.
      • FATAL: Critical errors leading to application termination.
  2. Standardize Logging Format:

    • Ensure logs include essential context such as timestamps, module/component names, and unique request/operation identifiers where applicable.
  3. Adopt a Logging Framework:

    • Choose or recommend a logging framework (e.g., klog, zap, or others) that integrates well with the Kubernetes ecosystem.
    • Ensure the framework supports structured logging for better integration with observability tools.
  4. Document Logging Guidelines:

    • Add a section in the developer documentation outlining logging conventions.
    • Include best practices for implementing logs, avoiding sensitive data in logs, and ensuring performance considerations.
  5. Refactor Existing Logs:

    • Audit and refactor existing log statements to align with the new conventions.
    • Remove redundant or unnecessary log statements.
  6. Acceptance Criteria

    • Logging levels and their definitions are documented.
    • A consistent logging framework is selected and integrated into the project.
    • Logging format is standardized across the codebase.
    • Documentation is updated with logging guidelines and examples.
    • Existing logs are refactored to follow the defined conventions.

See #90 (comment) for additional context.

@danehans
Copy link
Author

I included "Adopt a Logging Framework" above for completeness but the project currently uses klog which meets the documented criteria. If others agree, then check off A consistent logging framework is selected and integrated into the project. in the Acceptance Criteria section.

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