Node.js / NestJS

DevOps, Logging & CI/CD

Winston, Pino, structured logging, correlation IDs, APM, GitHub Actions, GitLab CI, pipelines, automated testing, deployment automation

25 câu hỏi phỏng vấn·
Mid-Level
1

What is the main difference between Winston and Pino?

Câu trả lời

Pino is designed to be extremely fast with low overhead (asynchronous by default), while Winston is more feature-rich but slightly slower. Pino uses structured JSON by default and avoids synchronous transformations, making it ideal for high-performance applications. Winston offers more transports and formatting options out of the box.

2

What is a correlation ID in the context of logging?

Câu trả lời

A correlation ID is a unique identifier (UUID) associated with an HTTP request or event, allowing tracing of all related operations across different services and logs. This facilitates debugging distributed systems by grouping all logs from the same transaction. It is typically propagated via HTTP headers (X-Correlation-ID).

3

What is the main advantage of structured logging?

Câu trả lời

Structured logging (logs in JSON format with key-value fields) allows easy filtering, searching, and analysis with tools like Elasticsearch, Grafana, or Datadog. Unlike plain text logs, structured logs can be indexed and queried efficiently. This greatly improves observability and debugging in production.

4

What are the standard log levels in Winston and Pino?

5

How to implement a global logger in NestJS?

+22 câu hỏi phỏng vấn

Nắm vững Node.js / NestJS cho lần phỏng vấn tiếp theo

Truy cập tất cả câu hỏi, flashcards, bài kiểm tra kỹ thuật, bài tập code review và mô phỏng phỏng vấn.

Bắt đầu miễn phí