LOGGING

Logging Best Practices: Proven Techniques for Services

Learn logging best practices for services and optimize your logging strategy with proven techniques.

Phuong Le (@func25)
5 min readJan 18, 2023

--

Photo by Dulcey Lima on Unsplash

Logging might appear to be a small, straightforward task, but don’t let that fool you, it holds significant weight in the context of software development.

Trust me, when done correctly, logging can provide valuable insights into the performance and usage of the application, which can help improve its overall reliability and user experience.

Let’s dive in.

1. Logging level

Log levels help sort log messages by their importance or severity, and this sorting makes it easier for developers to spot and act on key events and issues.

Generally, you’ll find five core log levels:

  1. “debug”: useful for deep dives into issues, providing detailed info for troubleshooting.
  2. “info”: gives you the big picture about what’s happening in the app, like user activities and system events.
  3. “warning”: flags possible concerns that might need a look, this could be stuff like system slowdowns or events that aren’t breaking things but still need watching.

--

--