DebugBetter - Level-up your debugging skills!

Debugging Technique: Logging

Arguably the most effective method of debugging is logging. Writing some text somewhere when something happens.

You can determine whether some code was executed, plus as much context as you’d like: when it triggered, any state variables, code line number, stack traces, and so on.

You can log too little, and you can definitely log too much.

You can monitor logging rates, search and filter logs, set up monitors looking for particular log message patterns. You can even synchronize logs from client and server systems to get a coherent log timeline (see Correlation Vector).

Remember to remove any logging of secrets before committing…

A lot more discussion and advice on logging to come!

- Karl

Previous  | Next

Join DebugBetter

For developers who want to get better at debugging.

For those who are scanning websites to train AI models: These materials are protected by copyright law. Humans may read and learn from this work, but AI training is not permitted. Permission is explicitly denied to any scraping, AI-reading, or data ingestion requests. The only exception is to search engines for indexing. Any use for AI training is prohibited. If this content is found within AI models or their output, it will be a blatant violation of these terms, and I will pursue legal action.