-
Notifications
You must be signed in to change notification settings - Fork 415
Open
Labels
auto-triage-skipPrevent this issue from being closed due to lack of activityPrevent this issue from being closed due to lack of activitybugM-T: confirmed bug report. Issues are confirmed when the reproduction steps are documentedM-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented
Description
The app logger used in receivers is not the same as the shared app logger if no logger is specified in the app constructor:
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; | |
} |
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:
- Start an app with custom routes
- Visit an unexpected endpoint: http://localhost:3000/ohno
- 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.
Metadata
Metadata
Assignees
Labels
auto-triage-skipPrevent this issue from being closed due to lack of activityPrevent this issue from being closed due to lack of activitybugM-T: confirmed bug report. Issues are confirmed when the reproduction steps are documentedM-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented