• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Alex Aitken

Technical and Engineering Leadership, Coaching, and Mentorship

Logging. How much is too much?

July 30, 2018 By Alex Leave a Comment

Logging has changed a lot in the past few years. It went from being something that you only do when there’s an error – to now logging every little bit of information you can. Why has this changed? Well, for starters, we now have better tools to read logs. Previously, we used to just store them as text somewhere. Maybe if you’re fancy, you’d store it in a database. Can you imagine combing through these files – looking for that one error that customer X reported? No, probably not. Especially when files ended up being 1GB or more. Having to open that file in a text editor was hell. But things change.

Debug/Info/Warning/Exception

Most languages or logging frameworks come with built-in levels for logging. Debug is usually the lowest level of logging that most people won’t need and you won’t need to send to your log database. Here is where you store things like “Method reached this point” – if you’re so inclined. I don’t think I’ve needed debug except for testing (or JS debugging). The next level is info. This is stuff you may want to keep. You might store here important calls or tasks. A warning is the next level. You’ll probably want to store exceptions or errors that you handle and recover from easily. The last level is an error. This may either by an unrecoverable exception/error or just a really bad error.

Along came Elastic Search

Over the past few years, I’ve been hearing a lot about Elastic Search. From how I understand it (being a more front-end guy – rather than dev-ops/backend focused), Elastic Search is a place where you can store all of your log messages and read them quickly. They provide a dashboard (Kibana) to visualise and drill down on your exceptions. Now, in .NET this is really easy if you use something like Serilog. All you need to do is add the ElasticSearch sink and configure it and you’re done. No need to write extra code! So you can just swap over your file-based log to a more sophisticated setup easily.

Logging as a Service

I’ve only had experience with Raygun, but I’m sure there are more sites that offer to log as a service. My experience with Raygun was pretty positive (I can’t say what it costed though as I wasn’t in charge of the budget). Raygun made logging quite smart. What it did was it grouped similar exceptions together – so that in the end – you would have an overview of what your most common exceptions are. This provided much-needed information to make decisions about what bugs to tackle or what would make the most impact or how often a bug was impacting customers.

How much is too much?

With the above changes in mind, I think we can safely say that you can’t really log too much. All this data that you collect – what is clicked and what is not – will be useful to your data scientists. You’ll be able to determine with data what works and doesn’t. This will give you a competitive edge. So, to answer the title question – there is no such thing as too much logging. Obviously – I don’t mean PII (Personal Identifying Information). You should avoid logging PII – especially things like credit cards or passwords. Avoid logging those at all costs.

And that’s it. You can log just about every interaction, every click or every error. What will come from this? Information. Information that your business can use now or in the future to make informed decisions. Because without the data – you’re just guessing.

Reposted on Medium.

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook

Like this:

Like Loading...

Related

Filed Under: Coding

Alex

Reader Interactions

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

About the author

Alex is an AVP of Engineering currently working at Bukalapak. He is a leader in full-stack technologies. Read More…

Pages

  • Speaking Experience
  • About

Social Profiles

  • LinkedIn
  • Medium
  • ADPList

Recent Posts

  • Interviewing as an Engineering Leader
  • Managing Low Performers
  • Getting Docker, React, .NET Core, Postgres, and Nginx Playing Nice
  • What Makes a Good Software Engineering Manager?
  • “Am I There Yet?” Said an Engineer

Archives

  • January 2025
  • August 2024
  • July 2024
  • October 2023
  • August 2023
  • October 2020
  • May 2020
  • February 2020
  • June 2019
  • March 2019
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • June 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018

Categories

  • Coding
  • Essay
  • Leadership
  • Management
  • Roundtable
  • Strategy

Footer

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright © 2025

%d