Skip to content

optimize: merge channel availability log output and adjust log level - #8203

Open
shenshichao163-oss wants to merge 3 commits into
apache:2.xfrom
shenshichao163-oss:optimize/channel-availability-log
Open

optimize: merge channel availability log output and adjust log level#8203
shenshichao163-oss wants to merge 3 commits into
apache:2.xfrom
shenshichao163-oss:optimize/channel-availability-log

Conversation

@shenshichao163-oss

Copy link
Copy Markdown

What this PR does

Optimizes the channel availability thread log output in NettyClientChannelManager.

Changes

  1. info level: no stack traces — Changed LOGGER.error() to LOGGER.info() for the summary log, which outputs all failed addresses in a single entry without stack traces.
  2. debug level: detailed stack traces — Changed LOGGER.error() to LOGGER.debug() for per-address detailed logs with full stack traces.
  3. Merged output — All failed addresses are output in one log entry at info level (using failedMap.keySet()), instead of one log per failed address.
  4. Independent log levels — Changed else if to two independent if blocks, so info and debug levels work independently rather than being mutually exclusive.

Issue Link

Fixes #5474

Before

  • LOGGER.isInfoEnabled()LOGGER.error() (wrong level, outputs error-level logs when info is enabled)
  • else if LOGGER.isDebugEnabled()LOGGER.error() (only reached when info is disabled)
  • Log level mismatch: info branch uses error, debug branch uses error

After

  • LOGGER.isInfoEnabled()LOGGER.info() (summary, no stack traces)
  • LOGGER.isDebugEnabled()LOGGER.debug() (per-address detailed stack traces)
  • Both levels work independently

Checklist

  • I have searched the issues of this repository and believe that this is not a duplicate.
  • I have checked that this modification does not cause CI to fail.
  • I will sign the Apache CLA if required.

- Change info level from LOGGER.error() to LOGGER.info() (summary without stack traces)
- Change debug level from LOGGER.error() to LOGGER.debug() (per-address detailed stack traces)
- All failed addresses merged into one log entry at info level
- Change else-if to independent if blocks so both levels work independently

Fixes apache#5474

@WangzJi WangzJi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix. The log level changes make sense, but #5474 is not fully addressed yet. doConnect() still logs the exception at ERROR before doReconnect() aggregates it, so an INFO-level client still prints one stack trace per unavailable address. Could you handle this path as well and keep stack traces only at DEBUG?

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.

optimize channel availability thread log output

2 participants