Skip to content

Logging code at DEBUG level in JavaNetHttpPollingClient wrongly displays the status code and response body values. #96

@AdrianVasiliu

Description

@AdrianVasiliu

If the log level is configured at DEBUG (or TRACE) level, a bug in the logging code here:

log.debug("Received status code [%s] for RestTableSource request " +
"with Server response body [%s] ", statusCode, responseBody);

prevents the log to show the values of statusCode and responseBody.

Instead, the log contains:

Received status code [%s] for RestTableSource request with Server response body [%s]

How to reproduce:
Execute any Flink job using the connector, with rootLogger.level = DEBUG in the log config.
Or, in the connector repo:

  1. Set the DEBUG level in https://github.com/getindata/flink-http-connector/blob/main/src/test/resources/log4j2-test.properties#L19
  2. mvn clean test -Dtest=JavaNetHttpPollingClientConnectionTest

=> the log contains:

Received status code [%s] for RestTableSource request with Server response body [%s]

while it should contain:

Received status code [201] for RestTableSource request with Server response body [{
  "id": "COUNTER", [...] ]

The issue is minor, as it only affects the logs, and this only at debug level. However, the debug logs are meant to help debugging... so there's value in fixing it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions