Skip to content

Feature/custom log formatting #1689

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mrtzgh
Copy link

@mrtzgh mrtzgh commented Jul 4, 2025

Add Configurable Log Formatting Options for Supervisor

Fixes #553 - This PR implements highly requested log formatting configuration options for Supervisor, addressing community feedback.

What's New

Two new configuration options:

  • logfile_format - Customizes main supervisord log messages
  • childlog_format - Customizes child process log messages (stdout/stderr)

Both support Python logging format strings with placeholders like %(asctime)s, %(levelname)s, %(process)d, etc.

Example Usage

[supervisord]
logfile_format=%(asctime)s [%(levelname)s] [PID:%(process)d] %(message)s
childlog_format=%(asctime)s [CHILD] %(message)s

Output:

# Main log
2024-01-15 10:30:15,123 [INFO] [PID:1234] supervisord started with pid 1234

# Child logs
2024-01-15 10:30:16,456 [CHILD] Starting application server

Key Features

backward compatible - existing configs work unchanged
error handling - invalid formats fall back to defaults
tests - all existing tests pass + new coverage
documentation - examples, best practices, troubleshooting

Benefits

  • Enhanced debugging with timestamps and PIDs
  • Better integration with log aggregation systems (ELK, Splunk, etc.)
  • Support for compliance logging requirements
  • Customizable formats for specific operational needs

This addresses a long-standing community request for better control over Supervisor's logging output while maintaining full compatibility.

@mrtzgh mrtzgh force-pushed the feature/custom-log-formatting branch from 444623f to 0b30bb3 Compare July 4, 2025 09:29
@mrtzgh mrtzgh marked this pull request as draft July 4, 2025 09:29
@mrtzgh mrtzgh marked this pull request as ready for review July 4, 2025 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to specify log format
1 participant