Skip to main content

Logging Guideline

ข้อมูลควบคุมเอกสาร (Document Control)​

ฟิลด์ค่า
ชื่อเอกสารCentral Log / Logging Guideline
Version1.0
สถานะApproved
วันที่ออกเอกสาร2026-04-07
ผู้จัดทำ (Author)Central Log Team
ผู้อนุมัติ (Approver)DIIS Development Guideline Team
มาตรฐานอ้างอิงISO/IEC 29110

ประวัติการแก้ไข (Change History)​

VersionDateAuthorDescription
1.02026-04-07Central Log TeamInitial release

ข้อมูลการจัดเก็บ​

Indices / Data streams format​

รูปแบบการตั้งชื่อ index สำหรับจัดเก็บ log ให้ใช้รูปแบบดังนี้

Naming Format

{domain}-{app_name}-{environment}-{log type}

  • domain — ชื่อ domain ของระบบ
  • app_name — ชื่อแอปพลิเคชัน (ถ้ามี)
  • environment — สภาพแวดล้อม เช่น production, staging
  • log type — ประเภทของ log เช่น audit, error, authentication

ตัวอย่าง

Index NameDomainApp NameEnvironmentLog Type
sport-production-auditsport-productionaudit
sport-production-errorsport-productionerror
hr-dss-staging-errorhrdssstagingerror

Authentication Log — REQUIRED​

เก็บข้อมูลการเข้าออกระบบ เช่น login, logout, เปลี่ยนรหัสผ่าน เป็นต้น

Log type: authentication

ข้อมูลที่จัดเก็บ

FieldRequiredDescription
username / user ID✅ชื่อผู้ใช้หรือ ID ที่ทำ action
IP address✅IP address ของผู้ใช้
action✅action ที่ดำเนินการ
agent (browser) detail❌รายละเอียด browser / user agent

Action ที่ต้องจัดเก็บ

  • Login
  • Logout
  • Change / Reset Password
  • PIN reset
  • Impersonate Login

Error Log — REQUIRED​

เก็บข้อมูล error exception detail ภายในระบบ เพื่อใช้ในการ debug และตรวจสอบปัญหา

Log type: error

ข้อมูลที่จัดเก็บ

FieldRequiredDescription
exception detail✅รายละเอียดของ error / exception ที่เกิดขึ้น

Action ที่ต้องจัดเก็บ

  • Catch error (ทุก exception ที่เกิดขึ้นภายในระบบ)

Audit Log — REQUIRED​

เก็บข้อมูล action ที่สำคัญภายในระบบ เช่น การกำหนดสิทธิ์ การ Create, Update, Delete ข้อมูล

Log type: audit

ข้อมูลที่จัดเก็บ

FieldRequiredDescription
username / user ID✅ชื่อผู้ใช้หรือ ID ที่ทำ action
IP address✅IP address ของผู้ใช้
action✅action ที่ดำเนินการ
agent (browser) detail❌รายละเอียด browser / user agent

Action ที่ต้องจัดเก็บ

  • ขึ้นอยู่กับระบบ เช่น การกำหนดสิทธิ์ผู้ใช้, CRUD ข้อมูลสำคัญ

Generic Log — optional​

เก็บข้อมูลอื่น ๆ ที่ต้องการจัดเก็บนอกเหนือจาก log ประเภทข้างต้น

Log type: generic

Action ที่ต้องจัดเก็บ

  • ข้อมูลทั่วไปที่ต้องการบันทึก ขึ้นอยู่กับความต้องการของแต่ละระบบ

Email Log — optional​

เก็บข้อมูลการส่งออก email จากระบบ เพื่อใช้ในการตรวจสอบและติดตามการส่ง email

Log type: email

Action ที่ต้องจัดเก็บ

  • การส่ง Email ออกจากระบบ (รวมถึงรายละเอียดผู้รับ, หัวข้อ, สถานะการส่ง)