Message is not sent if shutdown immediately
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, node.js
- Domain
- backend
Research direction
Start with the Slack appender and the linked feature-support-shutdown comparison, then review how log4js.shutdown() checks for shutdown support. Verify the immediate-termination example and the proposed callback behavior; done means the Slack request can finish or be given the proposed wait before process exit.
Written by the indexing model from the issue text.
Description
Overview
Since this module doesn't have shutdown function, request to slack is not reached if log4js.shutdown() is called and process is terminated right after message event.
For example:
https://github.com/expressjs/generator/blob/master/templates/js/www.ejs#L68
When I replace this logging with log4js + slack appender, it will not notify to slack.
Even if I put process.exit(1) within shutdown callback like
const log4js = require('log4js');
const logger = log4js.getLogger();
logger.error(bind + ' requires elevated privileges');
log4js.shutdown(() => {
process.exit(1);
});
it still won't wait process.exit() since slack appender doesn't support it.
As seen in log4js-node, it checks function existence.
https://github.com/log4js-node/log4js-node/blob/master/lib/log4js.js#L117
Appendix
If following proposal diff looks good, I'll make Pull Req.
https://github.com/log4js-node/slack/compare/master...honeroku:feature-support-shutdown
It doesn't guarantee that all request is done, but I suppose 1sec is enough (or even too much) for slack api.
And I don't want over-decorate this tiny module, so I made minimum support.
- Dominant language
- JavaScript
- Stars
- 8
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from log4js-node/slack
-
help wanted
Difficulty 5/5 Over a week Newbie friendliness 25/100
log4js-node/slack#2 · 4 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
log4js-node/slack#1 · 1 reaction ·
All issues in log4js-node/slack
Similar issues
-
area:docs bug triage:confirmed
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Cotal-AI/Cotal#2875 · 1 comment ·
Maintainers usually reply within 1 day
-
[Feature]:Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Uuriko/project-room#1554 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 4 days
-
automated issue report
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
lirantal/discoprint#36 ·
Maintainers usually reply within 1 day