Logging

Noun · Development

Definitions

  1. Logging is the practice of recording timestamped events, errors, warnings, and diagnostic messages from a running application to structured or unstructured output destinations such as files, stdout, or centralized platforms like the ELK stack (Elasticsearch, Logstash, Kibana), Splunk, or CloudWatch Logs. Logs serve multiple purposes: debugging failures, auditing access, tracking business events, and feeding alerting systems. Best practices include using severity levels (DEBUG, INFO, WARN, ERROR), structured JSON formatting for machine parsing, correlation IDs to trace requests across services, and log rotation to manage disk usage. Effective logging balances verbosity with performance, since excessive logging can degrade throughput and inflate storage costs.

    In plain English: Making your program write down what it's doing so you can figure out what went wrong when something breaks.

    Example: "Add more logging. When production breaks at 3 AM, logs are your only witness."

Related Terms