Skip to content

Conversation

diseku
Copy link

@diseku diseku commented Oct 9, 2025

Pull Request Checklist

Before submitting, make sure you've checked the following:

  • Target branch: Please verify that the pull request targets the dev branch.
  • Description: Provide a concise description of the changes made in this pull request.
  • Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
  • Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
  • Testing: Have you written and run sufficient tests to validate the changes?
  • Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
  • Prefix: To clearly categorize this pull request, prefix the pull request title using one of the following:
    • BREAKING CHANGE: Significant changes that may affect compatibility
    • build: Changes that affect the build system or external dependencies
    • ci: Changes to our continuous integration processes or workflows
    • chore: Refactor, cleanup, or other non-functional code changes
    • docs: Documentation update or addition
    • feat: Introduces a new feature or enhancement to the codebase
    • fix: Bug fix or error correction
    • i18n: Internationalization or localization changes
    • perf: Performance improvement
    • refactor: Code restructuring for better maintainability, readability, or scalability
    • style: Changes that do not affect the meaning of the code (white space, formatting, missing semi-colons, etc.)
    • test: Adding missing tests or correcting existing tests
    • WIP: Work in progress, a temporary label for incomplete or ongoing work

Changelog Entry

Description

  • Added configurable logging levels via LOG_LEVEL environment variable to reduce log noise in production environments. The feature allows users to control the verbosity of both Python application logs and uvicorn server logs through a single environment variable or CLI option.

Added

  • LOG_LEVEL environment variable support with default value of "INFO"
  • --log-level CLI option to override the environment variable
  • Support for all standard Python logging levels: DEBUG, INFO, WARNING, ERROR, CRITICAL
  • Graceful handling of invalid log levels with warning message and fallback to INFO
  • Consistent log level configuration for both Python logging and uvicorn server

Changed

  • Logging configuration in main.py now reads from LOG_LEVEL environment variable instead of being hardcoded to INFO
  • Uvicorn server log level now dynamically configured based on LOG_LEVEL environment variable
  • CLI interface enhanced with new --log-level option for runtime log level control

Deprecated

  • N/A

Removed

  • N/A

Fixed

  • N/A

Security

  • N/A

Breaking Changes

  • No breaking changes - The implementation maintains backward compatibility with existing deployments

Additional Information

  • Environment Variable: LOG_LEVEL (defaults to "INFO")
  • CLI Option: --log-level (overrides environment variable)
  • Supported Values: DEBUG, INFO, WARNING, ERROR, CRITICAL
  • Docker Compatibility: Works seamlessly with existing Dockerfile without modifications
  • Testing: Comprehensive testing performed with all log levels and invalid values

Usage Examples

# Using environment variable
export LOG_LEVEL=WARNING
mcpo --config config.json

# Using CLI option (overrides environment variable)
mcpo --log-level ERROR --config config.json

# Reduce log noise in production
export LOG_LEVEL=ERROR
mcpo --config config.json

# Docker usage
docker run -e LOG_LEVEL=WARNING your-mcpo-image --config /path/to/config.json

Screenshots or Videos

  • N/A (logging configuration changes are not visually demonstrable)

@diseku diseku mentioned this pull request Oct 9, 2025
1 task
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.

1 participant