node-slack-sdk icon indicating copy to clipboard operation
node-slack-sdk copied to clipboard

Add more helpful information in web-api debug logging

Open seratch opened this issue 1 year ago • 0 comments

As mentioned at https://github.com/slackapi/bolt-js/issues/1550 , debugging the web-api client ca be hard as its debug-level does not provide sufficient information.

When your app performs an apps.connections.open API call, the only information you can receive is blow:

[DEBUG]  web-api:WebClient:1 apiCall('apps.connections.open') start
[DEBUG]  web-api:WebClient:1 will perform http request
[DEBUG]  web-api:WebClient:1 http response received

Like Python and Java SDKs already do, we can add more meaningful information to the debug-level logging. One thing that we should be careful would be redact token data from the logging content. Refer to the following existing code for more details:

  • https://github.com/slackapi/python-slack-sdk/blob/v3.18.1/slack_sdk/web/base_client.py#L244-L259
  • https://github.com/slackapi/java-slack-sdk/blob/v1.24.0/slack-api-client/src/main/java/com/slack/api/util/http/listener/DetailedLoggingListener.java#L27-L36
  • https://github.com/slackapi/java-slack-sdk/blob/v1.24.0/slack-api-client/src/main/java/com/slack/api/util/http/listener/DetailedLoggingListener.java#L54-L59
  • https://github.com/slackapi/java-slack-sdk/blob/v1.24.0/slack-api-client/src/main/java/com/slack/api/util/http/listener/DetailedLoggingListener.java#L75-L80

Packages:

Select all that apply:

  • [x] @slack/web-api
  • [ ] @slack/rtm-api
  • [ ] @slack/webhooks
  • [ ] @slack/oauth
  • [ ] @slack/socket-mode
  • [ ] @slack/types
  • [ ] I don't know

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

seratch avatar Aug 10 '22 02:08 seratch