Logs vs Events – A hilarious take

Manisha Agrawal
2 min readOct 4, 2023

--

When my mother asks me over phone what was for lunch today, I start from what time the cook came, why I chose egg curry for today, what recipe was used, how I had to run to nearest grocery store for some ingredients, how much portion of mix veg was prepared to balance the left overs from yesterday. The conversation with her even includes how much time it took to prepare everything, how it tasted and what advise I would give to the cook for next time. That’s logs – chatty, descriptive, allow you to dissect step by step what happened. In contrast, when my husband asks me what are we having for lunch, I reply – “egg curry, rice, mix veg and something from yesterday”. That’s it, that’s events – a crisp summary of the most important part of the situation or something that demands an immediate action.

Both, logs and events are important and are monitored as per the use case. For example, if you are fully responsible for an application, you would like to monitor Logs but you would monitor only the Events for the upstream/downstream applications so that you can quickly assess the impact on your own application and take corrective actions.

Let’s discuss how logs and events are generated. All applications (vendor or in-house) produce text based log files that could have different extensions – .log, .txt, .json. ,xml, .csv anything. Developers decide at what point a log line should be written and what should be written. Logs can be structured or unstructured and sometimes they can be a mix of both (more on logging practices later). Some applications. write logs to console while some legacy applications write in binary. Logs are consumed depending on the sophistication of the monitoring tool.

Events are also text based and are produced at checkpoint stages in an application or when something demands an action. As a standard practice, they are stored in separate file and follow the same structure throughout the file. Common file extensions for Events file are .evt, evtx, .event and even .log or any custom extension.

I hope that this analogy will help you understand the difference between Logs and Events.

“Where this post belongs” in the Observability journey

#Observability #log #events #monitoring

--

--