Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Message is not sent if shutdown immediately

Đang mở
#6 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, node.js
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu với Slack appender và phần so sánh feature-support-shutdown được liên kết, sau đó xem xét cách log4js.shutdown() kiểm tra việc có hỗ trợ shutdown hay không. Xác minh ví dụ về việc kết thúc ngay lập tức và hành vi callback được đề xuất; hoàn thành khi yêu cầu Slack có thể hoàn tất hoặc được cho thời gian chờ được đề xuất trước khi tiến trình thoát.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
JavaScript
Star
8
Fork
8
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của log4js-node/slack

Tất cả issue của log4js-node/slack

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.