Skip to content

[Feature Request]: Implement structured logging with configurable log levels (DEBUG, INFO, WARN, ERROR) #283

Description

@divyanshim27

Summary

Celtrix currently lacks a structured, centralized logging system with configurable verbosity levels. Without a proper logging infrastructure, debugging production issues is difficult, and there is no consistent way to emit diagnostic information across the codebase.

Problem

  • Log output (if any) appears to be ad hoc rather than routed through a centralized logger.
  • There is no way for operators or developers to set a log level (e.g., LOG_LEVEL=DEBUG) to increase or decrease verbosity without modifying source code.
  • Structured logging (JSON output) is not available, making log aggregation in monitoring systems (Grafana, Datadog, ELK) impossible.
  • Debugging complex issues in production requires structured, filterable log output — raw console.log statements do not provide this.

Impact

  • Diagnosing production issues requires guesswork without structured, level-filtered log output.
  • The project cannot integrate with standard log aggregation pipelines used in production deployments.
  • As the codebase grows, unstructured logging makes it increasingly hard to trace the source of a specific log message.

Proposed Solution

  1. Create a Logger module supporting DEBUG, INFO, WARN, and ERROR levels with the following interface:
   const logger = createLogger({ level: process.env.LOG_LEVEL || 'INFO' });
   logger.info('Server started', { port: 3000 });
   logger.error('Connection failed', { host: 'db.example.com', err });
  1. Support two output formats: human-readable (for development) and JSON (for production/log aggregation), switchable via LOG_FORMAT=json environment variable.
  2. Include timestamps, log level, and source module in every log entry.
  3. Replace existing ad hoc log calls throughout the codebase with calls to the centralized logger.
  4. Document the logger API and environment variable configuration in the README.

Additional Notes

  • I will implement this without adding heavy external dependencies — a lightweight custom logger or a minimal well-maintained library (like pino) will be used.
  • Could you assign this to me?

Labels: enhancement, feature, infrastructure, GSSoC 2026

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions