Skip to content
Ameen Abozaid
Planned lessonJNR-054-L02

Logs and stack traces in production

  • Lesson 2 of 6
  • Junior
On This Lesson 4 topics

This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.

In this lesson

read deployed logs to find where a failure starts.

Planned topics

  • 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 ERROR and WARN, then look at the lines just before the first error.
  • Do not log secrets or personal data.
Draft outline details

Demonstration

text
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)

Check your understanding

Which part of a stack trace usually names the root cause?

Show answer

The last "Caused by".

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Continue to next lesson

Type to search levels, phases, modules and lessons.