What is logging?

Logging stores requests, errors, and what the app did, so you can read it later.

What it is

Logging is the record of what the app did. A request arrived, an error happened, something went wrong at three in the morning. Without logs you only see that something is wrong. You do not see where.

Without a line that has a time and a name for what happened, an error is only the news that something is wrong.

What it is made of

A log is a line or a block with a time, often a level such as info, warning, or error, and a message. Good logs name the action, the request it belongs to, and the reason. Bad logs only say “error”, or they print everything, including passwords. Both are useless: one is too little, the other is too much and unsafe.

What goes wrong

The lines need a place. On the server disk they are deleted eventually, or the disk fills up. In a collector they stay searchable, even after the container starts again. Then there is the question of how long you keep them. Too short, and yesterday’s error is gone. Too long, and you store data you do not need.

What you otherwise look after yourself

In your own setup you build that place for every project. Format, retention, and access are otherwise different every time, and when it matters you look in the wrong place.

How it shows up on MainPath

On MainPath logging is part of running the project. Crashes and exceptions also land in Sentry, so you see the path up to the error, not only one line.

All terms