Every defence so far tries to stop an attack. None is perfect, so a second question matters: if something gets through, will anyone know? Logging is the record systems write about what happened: who signed in, what they asked for, what the server answered.
Think of the shop at shop.example: customers, an app and a database. After an incident, the team will need to answer four questions: who did it, what did they touch, when did it start, and is it still going on. Without records, each answer is a guess.
💡Good to know
Decide now which questions you will need answered later, then record the facts that answer them.