8000 App logger is not passed to receivers · Issue #2521 · slackapi/bolt-js · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

App logger is not passed to receivers #2521

New issue

Have a question about this project? Sign up for a free GitHub account to open an i 8000 ssue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
zimeg opened this issue May 8, 2025 · 1 comment
Open

App logger is not passed to receivers #2521

zimeg opened this issue May 8, 2025 · 1 comment
Labels
auto-triage-skip Prevent this issue from being closed due to lack of activity bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented

Comments

@zimeg
Copy link
Member
zimeg commented May 8, 2025

The app logger used in receivers is not the same as the shared app logger if no logger is specified in the app constructor:

bolt-js/src/App.ts

Lines 323 to 331 in ee8df73

/* ------------------------ Set logger ----------------------------- */
if (typeof logger === 'undefined') {
// Initialize with the default logger
const consoleLogger = new ConsoleLogger();
consoleLogger.setName('bolt-app');
this.logger = consoleLogger;
} else {
this.logger = logger;
}

bolt-js/src/App.ts

Lines 405 to 421 in ee8df73

this.receiver = this.initReceiver(
receiver,
signingSecret,
endpoints,
port,
customRoutes,
processBeforeResponse,
signatureVerification,
clientId,
clientSecret,
stateSecret,
redirectUri,
installationStore,
scopes,
appToken,
logger,
);

The constructed logger might be used here instead? 🤔

@slack/bolt version

@slack/bolt@4.3.0

Your App and Receiver Configuration

const app = new App({
  token: process.env.SLACK_BOT_TOKEN,
  socketMode: true,
  appToken: process.env.SLACK_APP_TOKEN,
  logLevel: LogLevel.DEBUG,
  customRoutes: [
    {
      path: '/health-check',
      method: ['GET'],
      handler: (req, res) => {
        res.writeHead(200);
        res.end(`Things are going just fine at ${req.headers.host}!`);
      },
    },
  ],
});

Node.js runtime version

v22.14.0

Steps to reproduce:

  1. Start an app with custom routes
  2. Visit an unexpected endpoint: http://localhost:3000/ohno
  3. Review the logs

Expected result:

[INFO]  bolt-app An unhandled HTTP request (GET) made to /ohno was ignored

Actual result:

[INFO]   An unhandled HTTP request (GET) made to /ohno was ignored

Requirements

For general questions/issues about Slack API platform or its server-side, could you submit questions at https://my.slack.com/help/requests/new instead. 🙇

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

@zimeg zimeg added the bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented label May 8, 2025
Copy link
github-actions bot commented Jun 9, 2025

👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out. If you think this issue needs to be prioritized, please comment to get the thread going again! Maintainers also review issues marked as stale on a regular basis and comment or adjust status if the issue needs to be reprioritized.

@zimeg zimeg added auto-triage-skip Prevent this issue from being closed due to lack of activity and removed auto-triage-stale labels Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-triage-skip Prevent this issue from being closed due to lack of activity bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented
Projects
None yet
Development

No branches or pull requests

1 participant
0