loopbackio / loopbackio/loopback-next

Logging Extension Improvements

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

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

feature
Ngôn ngữ chính
TypeScript
Star
5.1k
Fork
1.1k
Merge trung bình
2 ngày 21 giờ
Pull request đã merge (30 ngày)
27

Mô tả

Suggestion

  • should include a global logger for use outside of the application so that we can make sure to catch and log exceptions for problems with the application boot-up. console.log won't cut it here as logs still need to be json structured and sent to an external logging service.

  • Http Access Logs should be json structured rather than putting the log in string format.

Use Cases

I'm deploying my application to Google App Engine and structure logs for both normal logs as well as error logs is an absolute must to correctly parse any problems.

Examples

Logging should be tightly integrated with the application. A global logger should be setup and passed into the application as part of the application initialisation (I suggest simply choosing winston by convention). The global logger can then be accessed by the migration scripts, and can also be used inside the main function for circumstances where the application doesn't boot.

The HTTP Access Logger should be a middleware that takes a callback with some for such as:

LogCallbackFn(logger: WinstonLogger, req: Request, res: Response)

This way the logger call can be customised.

Acceptance criteria

TBD - will be filled by the team.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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.

Hướng nghiên cứu

Bắt đầu bằng cách xác định đường dẫn khởi tạo ứng dụng, các script migration, hàm main và middleware ghi log truy cập HTTP. Làm rõ các tiêu chí chấp nhận còn thiếu với nhóm, sau đó xác định việc hoàn thành là khi có một logger có cấu trúc dùng toàn cục, khả dụng trong quá trình boot và migration, cùng với các log truy cập HTTP JSON có thể tùy chỉnh, phù hợp cho các dịch vụ bên ngoài.

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

Đánh giá

Công nghệ
google-cloud, node.js, typescript
Lĩnh vực
api, backend, observability
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
20/100

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.