# DevOps, Logging และ CI/CD (Node.js / NestJS) > Winston, Pino, structured logging, correlation ID, APM, GitHub Actions, GitLab CI, pipeline, การทดสอบอัตโนมัติ, การทำ deployment อัตโนมัติ - 25 คำถามสัมภาษณ์ - Mid-Level - [คำถามสัมภาษณ์: Node.js / NestJS](https://sharpskill.dev/th/technologies/node-nestjs/interview-questions.md) ## 1. ความแตกต่างหลักระหว่าง Winston และ Pino คืออะไร? **คำตอบ** Pino ถูกออกแบบมาให้เร็วมากโดยมี overhead ต่ำ (เป็นแบบ asynchronous โดยค่าเริ่มต้น) ในขณะที่ Winston มีฟีเจอร์มากกว่าแต่ช้ากว่าเล็กน้อย Pino ใช้ JSON แบบมีโครงสร้างโดยค่าเริ่มต้นและหลีกเลี่ยงการแปลงแบบ synchronous ทำให้เหมาะกับแอปพลิเคชันที่ต้องการประสิทธิภาพสูง Winston มี transport และตัวเลือกการจัดรูปแบบให้ใช้งานได้ทันทีมากกว่า ## 2. correlation ID ในบริบทของ logging คืออะไร? **คำตอบ** correlation ID คือตัวระบุที่ไม่ซ้ำกัน (UUID) ที่เชื่อมโยงกับ request HTTP หรือ event ซึ่งช่วยให้ติดตามการดำเนินการที่เกี่ยวข้องทั้งหมดข้ามบริการและ log ต่าง ๆ ได้ สิ่งนี้ช่วยให้การดีบักระบบแบบกระจายง่ายขึ้นโดยการจัดกลุ่ม log ทั้งหมดของทรานแซกชันเดียวกัน โดยทั่วไปจะถูกส่งต่อผ่าน HTTP header (X-Correlation-ID) ## 3. ข้อได้เปรียบหลักของ structured logging คืออะไร? **คำตอบ** structured logging (log ในรูปแบบ JSON ที่มีฟิลด์แบบ key-value) ช่วยให้กรอง ค้นหา และวิเคราะห์ log ได้ง่ายด้วยเครื่องมืออย่าง Elasticsearch, Grafana หรือ Datadog ต่างจาก log แบบข้อความธรรมดา log ที่มีโครงสร้างสามารถทำดัชนีและ query ได้อย่างมีประสิทธิภาพ สิ่งนี้ช่วยปรับปรุง observability และการดีบักในโปรดักชันได้อย่างมาก ## มีอีก 22 คำถาม - ระดับ log มาตรฐานใน Winston และ Pino มีอะไรบ้าง? - จะใช้งาน logger แบบ global ใน NestJS ได้อย่างไร? สมัครฟรี: https://sharpskill.dev/th/login ## หัวข้อสัมภาษณ์ Node.js / NestJS อื่นๆ - [พื้นฐาน Node.js](https://sharpskill.dev/th/technologies/node-nestjs/interview-questions/nodejs-fundamentals.md): 20 คำถาม, Junior - [Core API ของ Node.js](https://sharpskill.dev/th/technologies/node-nestjs/interview-questions/nodejs-core-apis.md): 25 คำถาม, Junior - [การเขียนโปรแกรมแบบอะซิงโครนัส](https://sharpskill.dev/th/technologies/node-nestjs/interview-questions/asynchronous-programming.md): 25 คำถาม, Junior - [พื้นฐาน Express.js](https://sharpskill.dev/th/technologies/node-nestjs/interview-questions/express-basics.md): 20 คำถาม, Junior - [พื้นฐาน NestJS](https://sharpskill.dev/th/technologies/node-nestjs/interview-questions/nestjs-fundamentals.md): 23 คำถาม, Junior - [การออกแบบ REST API](https://sharpskill.dev/th/technologies/node-nestjs/interview-questions/rest-api-design.md): 20 คำถาม, Junior - [การตรวจสอบความถูกต้องและ DTO](https://sharpskill.dev/th/technologies/node-nestjs/interview-questions/validation-dto.md): 20 คำถาม, Junior - [เอกสาร API และ Contract](https://sharpskill.dev/th/technologies/node-nestjs/interview-questions/api-documentation.md): 20 คำถาม, Junior - [การจัดการข้อผิดพลาด](https://sharpskill.dev/th/technologies/node-nestjs/interview-questions/error-handling.md): 20 คำถาม, Junior - [การทดสอบหน่วย (Unit Testing)](https://sharpskill.dev/th/technologies/node-nestjs/interview-questions/testing-unit.md): 20 คำถาม, Junior - [การจัดตารางงาน](https://sharpskill.dev/th/technologies/node-nestjs/interview-questions/scheduling-cron.md): 15 คำถาม, Junior - [Module และ DI ของ NestJS](https://sharpskill.dev/th/technologies/node-nestjs/interview-questions/nestjs-modules-di.md): 20 คำถาม, Mid-Level - [การกำหนดค่าและการจัดการสภาพแวดล้อม](https://sharpskill.dev/th/technologies/node-nestjs/interview-questions/configuration-environment.md): 20 คำถาม, Mid-Level - [การยืนยันตัวตนด้วย JWT](https://sharpskill.dev/th/technologies/node-nestjs/interview-questions/authentication-jwt.md): 25 คำถาม, Mid-Level - [การให้สิทธิ์และ RBAC](https://sharpskill.dev/th/technologies/node-nestjs/interview-questions/authorization-rbac.md): 20 คำถาม, Mid-Level - [ฐานข้อมูลด้วย TypeORM](https://sharpskill.dev/th/technologies/node-nestjs/interview-questions/database-typeorm.md): 30 คำถาม, Mid-Level - [Prisma ORM](https://sharpskill.dev/th/technologies/node-nestjs/interview-questions/prisma-orm.md): 25 คำถาม, Mid-Level - [Middleware และ Interceptor](https://sharpskill.dev/th/technologies/node-nestjs/interview-questions/middleware-interceptors.md): 20 คำถาม, Mid-Level - [การอัปโหลดไฟล์](https://sharpskill.dev/th/technologies/node-nestjs/interview-questions/file-upload.md): 15 คำถาม, Mid-Level - [WebSockets](https://sharpskill.dev/th/technologies/node-nestjs/interview-questions/websockets.md): 20 คำถาม, Mid-Level - [GraphQL กับ NestJS](https://sharpskill.dev/th/technologies/node-nestjs/interview-questions/graphql-basics.md): 25 คำถาม, Mid-Level - [การทดสอบแบบ End-to-End](https://sharpskill.dev/th/technologies/node-nestjs/interview-questions/testing-e2e.md): 20 คำถาม, Mid-Level - [การแคชด้วย Redis](https://sharpskill.dev/th/technologies/node-nestjs/interview-questions/caching-redis.md): 20 คำถาม, Mid-Level - [คิวด้วย Bull](https://sharpskill.dev/th/technologies/node-nestjs/interview-questions/queues-bull.md): 20 คำถาม, Mid-Level - [Docker และ Containerization](https://sharpskill.dev/th/technologies/node-nestjs/interview-questions/docker-containerization.md): 25 คำถาม, Mid-Level - [ไมโครเซอร์วิส](https://sharpskill.dev/th/technologies/node-nestjs/interview-questions/microservices.md): 30 คำถาม, Senior - [แนวทางปฏิบัติที่ดีที่สุดด้านความปลอดภัย](https://sharpskill.dev/th/technologies/node-nestjs/interview-questions/security-best-practices.md): 25 คำถาม, Senior - [ประสิทธิภาพและการ Deploy บน Cloud](https://sharpskill.dev/th/technologies/node-nestjs/interview-questions/performance-optimization.md): 30 คำถาม, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/th/technologies/node-nestjs/interview-questions/logging-monitoring