I am unable to specify the log level after upgrading from 1.2.0 to 1.4.0 and up.
x in one of the [ ])x in each of the [ ])Filling out the following details about bugs will help us solve your issue sooner.
package version: >= 1.4.0
node version: v12.12.0
OS version(s): macOS Catalina 10.15.1
logLevel when creating a Bolt app in >= 1.4.0What you expected to happen
I expect to see the logger initialized for WebClient:0 after the Bolt app is initialized.
i.e.
[DEBUG] WebClient:0 initialized
Upon initialization of the bolt app, I get:
[DEBUG] The logLevel given to WebClient was ignored as you also gave logger
[DEBUG] initialized
It seems that every time the logger attempts to log, i get another [DEBUG] initialized message.
Another symptom i noticed is that all the logs messages aren't prefixed with a logger name i.e. WebClient:0 but rather they're prefixed with a space.
logs are posted above
Thanks for taking the time to report this. You're right. The behavior needs to be improved. I just finished the implementation to address this issue. I will make a pull request within a few hours. It would be appreciated if you could take a look at the fix and give feedback on it if you have some.
Thanks for taking the time to report this. You're right. The behavior needs to be improved. I just finished the implementation to address this issue. I will make a pull request within a few hours. It would be appreciated if you could take a look at the fix and give feedback on it if you have some.
Thank you so much for getting back to me and deciding to take action so quickly!
I think it's also worth noting that i'm unable to specify a log level by creating my own logger as you did in https://github.com/slackapi/bolt/pull/406 to show how to customize the logger name. When I specify a log level of DEBUG I end up getting no logging information.
i.e.
const { LogLevel, ConsoleLogger } = require("@slack/logger");
const logger = new ConsoleLogger();
logger.setName('my-bolt-app');
logger.setLevel(LogLevel.DEBUG);
const { App } = require("@slack/bolt");
const app = new App({
logger: logger,
token: process.env.SLACK_BOT_TOKEN,
signingSecret: process.env.SLACK_SIGNING_SECRET
});
results in
鈿★笍 Bolt app is running!
@zachsirotto No worries. I'm aware of the issue. The PR addresses the issue as well.
Thanks for flagging this. The fix has been merged. This issue will be fixed in bolt version 1.7.x / 2.x. They'll be released soon (if everything goes well, both of them will be shipped within a month).
Most helpful comment
@zachsirotto No worries. I'm aware of the issue. The PR addresses the issue as well.