-
Notifications
You must be signed in to change notification settings - Fork 0
feat(logging): Add structured logging (Issue #695) #736
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
Changes from all commits
0ebb8d3
1593579
c6cdc1a
acd0160
d943f79
a82f866
d5b1769
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| # Code Ownership Rules | ||
| # | ||
| # This CODEOWNERS file defines code ownership and review requirements for the ModPorter-AI project. | ||
| # Review is required from code owners before merging changes. | ||
| # | ||
| # For more information about CODEOWNERS, see: | ||
| # https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners | ||
|
|
||
| # ============================================================================ | ||
| # Default Owners (catch-all for any file not matching specific rules) | ||
| # ============================================================================ | ||
| * @alex | ||
|
|
||
| # ============================================================================ | ||
| # Frontend Team - React/TypeScript UI Components | ||
| # ============================================================================ | ||
| # All frontend-related files require review from frontend maintainers | ||
| /frontend/ @alex | ||
|
|
||
| # ============================================================================ | ||
| # Backend Team - Python API and Server | ||
| # ============================================================================ | ||
| # All backend-related files require review from backend maintainers | ||
| /backend/ @alex | ||
|
|
||
| # ============================================================================ | ||
| # AI-Engine Team - ML/AI Components | ||
| # ============================================================================ | ||
| # All AI engine-related files require review from AI engine maintainers | ||
| /ai-engine/ @alex | ||
|
|
||
| # ============================================================================ | ||
| # Infrastructure & DevOps | ||
| # ============================================================================ | ||
| # Docker and infrastructure configurations | ||
| /docker/ @alex | ||
| docker-compose*.yml @alex | ||
| Dockerfile* @alex | ||
|
|
||
| # ============================================================================ | ||
| # Security & Compliance | ||
| # ============================================================================ | ||
| # Security-related files require review from security team | ||
| /.github/security-check.sh @alex | ||
| /.github/security-config-guide.md @alex | ||
|
|
||
| # ============================================================================ | ||
| # Documentation | ||
| # ============================================================================ | ||
| # Documentation changes can be reviewed by any maintainer | ||
| /docs/ @alex | ||
| *.md @alex | ||
| !/.github/*.md | ||
|
|
||
| # ============================================================================ | ||
| # Configuration Files | ||
| # ============================================================================ | ||
| # Project-wide configuration files | ||
| /.github/ @alex | ||
| /database/ @alex | ||
| /monitoring/ @alex | ||
| /scripts/ @alex | ||
| /modporter/ @alex | ||
| /tests/ @alex | ||
|
|
||
| # ============================================================================ | ||
| # CI/CD Workflows | ||
| # ============================================================================ | ||
| /.github/workflows/ @alex |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -16,13 +16,20 @@ | |||||||||||||||||||||||||||||
| import redis.asyncio as aioredis | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # Configure logging using centralized configuration | ||||||||||||||||||||||||||||||
| from utils.logging_config import setup_logging, get_agent_logger | ||||||||||||||||||||||||||||||
| from utils.logging_config import setup_logging, get_agent_logger, configure_structlog | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # Load environment variables | ||||||||||||||||||||||||||||||
| load_dotenv() | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # Setup logging with environment-based configuration | ||||||||||||||||||||||||||||||
| debug_mode = os.getenv("DEBUG", "false").lower() == "true" | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # Also configure structlog for structured JSON logging in production | ||||||||||||||||||||||||||||||
| configure_structlog( | ||||||||||||||||||||||||||||||
| debug_mode=debug_mode, | ||||||||||||||||||||||||||||||
| json_format=os.getenv("LOG_JSON_FORMAT", "false").lower() == "true" | ||||||||||||||||||||||||||||||
|
Comment on lines
+27
to
+30
|
||||||||||||||||||||||||||||||
| # Also configure structlog for structured JSON logging in production | |
| configure_structlog( | |
| debug_mode=debug_mode, | |
| json_format=os.getenv("LOG_JSON_FORMAT", "false").lower() == "true" | |
| # Determine JSON logging format. If LOG_JSON_FORMAT is unset, pass None so | |
| # configure_structlog() can apply its own environment-based default (e.g. enable | |
| # JSON automatically in production). | |
| log_json_env = os.getenv("LOG_JSON_FORMAT") | |
| json_format = log_json_env.lower() == "true" if log_json_env is not None else None | |
| # Also configure structlog for structured JSON logging in production | |
| configure_structlog( | |
| debug_mode=debug_mode, | |
| json_format=json_format, |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,4 +48,5 @@ pydantic-settings | |
|
|
||
| # Monitoring | ||
| prometheus-client | ||
| psutil | ||
| psutil | ||
| structlog>=24.0.0 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The health-check endpoints table is malformed Markdown because each row starts with
||instead of|. This won’t render as a table on GitHub; remove the extra leading pipe so it’s a standard markdown table.