slackapi / slackapi/bolt-js

log level returned by getLevel function in custom logger not being respected.

Open
#1,812 8 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triage-skip docs enhancement
Dominant language
TypeScript
Stars
2.9k
Forks
445
Avg merge
1d 3h
Merged PRs (30d)
28

Description

(Filling out the following with as much detail as you can provide will help us solve your issue sooner.)

Reproducible in:
The Slack SDK version

"slack/bolt": "^3.13.0",

Node.js runtime version

v18.14.0

OS info
ProductName:            macOS
ProductVersion:         13.3
BuildVersion:           22E252
Darwin Kernel Version 22.4.0: Mon Mar  6 21:00:41 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T8103
Steps to reproduce:

(Share the commands to run, source code, and project settings)

  1. provide a logger to the new App() constructor
  2. make logger getLevel method return info as the log level.
Expected result:

boltJS client should log at INFO level.

Actual result:

Logging at the DEBUG level.

[19:08:13.919] DEBUG (28297):
    0: "initialized"
[19:08:19.237] DEBUG (28297):
    0: "Initializing HTTPReceiver"
[19:08:19.237] DEBUG (28297):
    0: "The logLevel given to OAuth was ignored as you also gave logger"
[19:08:19.238] DEBUG (28297):
    0: "The logLevel given to WebClient was ignored as you also gave logger"
[19:08:19.238] DEBUG (28297):
    0: "initialized"

It seems like it's ignoring the value returned by getLevel(). I verified that the function is being called and is returning info by using breakpoints, and that it's calling my logger's debug function when logging the above messages. The The logLevel given to OAuth was ignored as you also gave logger are also somewhat confusing.

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the custom-logger case through the new App constructor, with getLevel returning info, then trace the logger handling that invokes debug. Done means the configured info level is respected instead of producing DEBUG output; the payload does not name a source file or test to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.