Language selector

Logging

Let me start this entry with a dad joke.

Simplified atom model

An electron rides a motorcycle. Suddenly, a police officer stops the electron and says:

‘I had to stop you, because you were speeding, driving exactly 178 and half kilometres per hour.’

‘Well, THANK YOU VERY MUCH, officer!’ the electron says, ‘Now I have absolutely no idea where I am!!!’

Some dad jokes are terrible, and don’t worry if you don’t get this one. It boils down to the uncertainty principle. In extremely oversimplified version: some things in the universe can’t be observed in all their aspects. If you have an apple, you can measure it’s mass, volume, size, (and if falls on your head) velocity, all at the same time. Without affecting the apple itself.
However, if you’re interested in electrons, the more accurately you know its speed, the less you know its location, and vice versa, hence atomic orbital. (Gosh, will atomic things stop chasing me? 😅)

There are 10 kinds of people: the ones who already log stuff and the ones who will. ;-) But what can be fascinating about logging? It’s just adding some statements of given level to a file in /var/log, so what’s this presentation for in the fist place? Well, ordinary adding lines to /var/log and tracing them with tail -f or searching with grep is so… 1980 and inefficient. Meet Graylog: a centralised and distributed log management system. A tool, which will let you gather, process, analyse logs from many sources: syslog, your application, Apache/Nginx, database, firewall, etc. It can alert, search all ways through, analyse the logs no matter what language/technology sent them. And it makes that good. And is Open Source. This presentation is about some gotchas based on real-life experience, quick Graylog setup, wiring your apps/systems/servers, analysing logs after. Even if the machine which sent them is already gone.