Skip to content

Conversation

@MayorFaj
Copy link

Commit Message:
Added support for group-based logging control via the /logging admin endpoint. Users can now change log levels for predefined groups of loggers using /logging?group=<group_name>:<level> (e.g., /logging?group=http:trace). This feature requires fine-grain logging to be enabled and simplifies debugging by allowing log level changes for entire subsystems with a single command instead of manually specifying individual file patterns.

Implemented 16 predefined logger groups covering major Envoy subsystems: http, router, network, upstream, connection, admin, config, grpc, filter, listener, tls, quic, tracing, stats, runtime, and secret. Each group maps to relevant source file patterns, allowing comprehensive debugging of specific components.

Additional Description:
This PR addresses the feature request in #42434 to add group-based logging support. The implementation includes:

  • Static map of 16 predefined logger groups in LogsHandler::getLoggerGroups()
  • Group parameter parsing with whitespace trimming for flexible input
  • Validation for group names, log levels, and fine-grain logging enablement
  • Comprehensive unit tests covering valid/invalid inputs and whitespace handling
  • Updated admin endpoint parameter documentation

The groups cover frequently debugged areas including networking (http, network, connection, quic, tls), routing (router, upstream), configuration (config, runtime, secret), and observability (stats, tracing, admin, grpc).

Risk Level: Low
Small feature addition that extends existing logging functionality without changing core behavior.

Testing:

  • Unit tests in logs_handler_test.cc covering:
    • Valid group names with log level changes
    • Invalid group names, empty parameters, invalid levels
    • Whitespace handling around delimiters
    • Multiple files matching group patterns
    • Error message formatting
  • Verified logic with standalone C++ tests (all passed)
  • Manual testing not possible on macOS x86_64 due to build limitations

Docs Changes:

  • Updated admin endpoint parameter description in source/server/admin/admin.cc
  • Added usage documentation in help text output

Release Notes:
Added to changelogs/current.yaml under admin section documenting the new feature and listing all 16 available groups.

Platform Specific Features:
N/A

Fixes #42434

@repokitteh-read-only
Copy link

Hi @MayorFaj, welcome and thank you for your contribution.

We will try to review your Pull Request as quickly as possible.

In the meantime, please take a look at the contribution guidelines if you have not done so already.

🐱

Caused by: #42517 was opened by MayorFaj.

see: more, trace.

@MayorFaj MayorFaj marked this pull request as draft December 10, 2025 05:13
@repokitteh-read-only repokitteh-read-only bot added api deps Approval required for changes to Envoy's external dependencies labels Dec 15, 2025
@repokitteh-read-only
Copy link

CC @envoyproxy/coverage-shephards: FYI only for changes made to (test/coverage.yaml).
envoyproxy/coverage-shephards assignee is @RyanTheOptimist
CC @envoyproxy/runtime-guard-changes: FYI only for changes made to (source/common/runtime/runtime_features.cc).
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @adisuissa
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).
CC @envoyproxy/dependency-shepherds: Your approval is needed for changes made to (bazel/.*repos.*\.bzl)|(bazel/dependency_imports\.bzl)|(api/bazel/.*\.bzl)|(.*/requirements\.txt)|(.*\.patch).
envoyproxy/dependency-shepherds assignee is @agrawroh

🐱

Caused by: #42517 was synchronize by MayorFaj.

see: more, trace.

Add three additional high-value logger groups for comprehensive debugging:
- stats: Statistics/metrics system debugging
- runtime: Runtime configuration and feature flags
- secret: Secret/credential management

Signed-off-by: MayorFaj <[email protected]>
…andler

test: enhance log level assertions for admin group in logs_handler_test

Signed-off-by: MayorFaj <[email protected]>
- Fix line breaking in logger groups initialization
- Fix comment spacing to follow style guide
- Adjust ENVOY_LOG call formatting

Signed-off-by: MayorFaj <[email protected]>
@MayorFaj MayorFaj force-pushed the feature/group-based-logging branch from 4c9f64d to fff2a14 Compare December 15, 2025 23:14
@MayorFaj MayorFaj marked this pull request as ready for review December 15, 2025 23:15
@agrawroh
Copy link
Member

Waiting on the triggers to pass.

/wait

@MayorFaj
Copy link
Author

Waiting on the triggers to pass.

/wait

are the test flaky, or do I need to do anything to fix this?

@agrawroh
Copy link
Member

/retest

@adisuissa
Copy link
Contributor

Assigning @botengyao as the creator of the issue (#42434).
/assign @botengyao

@ravenblackx
Copy link
Contributor

are the test flaky, or do I need to do anything to fix this?

If you click through on the envoy/checks or envoy/prechecks workflow (several clicks deep unfortunately) you can find what tests failed.
In this case

//test/server/admin:admin_test
//test/server/admin:logs_handler_test

Given that these tests are related to the changes you're making it's almost certainly related to your changes, not test flakes.

/wait

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api deps Approval required for changes to Envoy's external dependencies waiting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow group operation on fine-grain loggers from adminz

6 participants