السجلات وتتبّع المكدس (Stack traces) في الإنتاج
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
read deployed logs to find where a failure starts.
الموضوعات المخطط لها
- Find the time of the problem, then read around it (
docker logs --since 10m,journalctl -u shop --since ...). - In a stack trace, read the exception type and message, then the "Caused by" chain to the root cause; the first lines of your own package show where.
- Use a request or correlation id to follow one request through the logs.
- Search for
ERRORandWARN, then look at the lines just before the first error. - Do not log secrets or personal data.
تفاصيل المخطط المبدئي
عرض عملي
ERROR OrderService - Could not place order 4711
org.springframework.dao.DataIntegrityViolationException: ...
Caused by: org.postgresql.util.PSQLException: ERROR: null value in column "currency"
at com.shop.order.OrderService.place(OrderService.java:58)اختبر فهمك
Which part of a stack trace usually names the root cause?
أظهر الإجابة
The last "Caused by".
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.