<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/when-and-what-should-i-be-logging--muc9vc2tm" -->

---
title: When and what should I be logging? | daily.dev
description: Practical guidance on logging best practices for production applications. Covers what to log (runtime decisions, algorithm outcomes, audit events, error...
canonical: https://daily.dev/posts/when-and-what-should-i-be-logging--muc9vc2tm
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: When and what should I be logging? | daily.dev
og:description: Practical guidance on logging best practices for production applications. Covers what to log (runtime decisions, algorithm outcomes, audit events, error...
og:url: https://daily.dev/posts/when-and-what-should-i-be-logging--muc9vc2tm
og:image: https://api.daily.dev/og/posts/muC9VC2TM.png
og:image:alt: When and what should I be logging?
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# When and what should I be logging?

**[Sentry Engineering](https://daily.dev/sources/sentry)** · 9 min read · 0 upvotes · 0 comments

## Summary

Practical guidance on logging best practices for production applications. Covers what to log (runtime decisions, algorithm outcomes, audit events, error context), how to structure log messages using key/value pairs, choosing appropriate log levels (debug/info/warn/error), and what to avoid (PII, secrets, excessive data blobs, every function call). Includes real-world code examples using Sentry's structured logging API, tips on accumulating request context, and warnings about compliance requirements like GDPR and HIPAA.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.sentry.io/logging-best-practices>

## Similar posts on daily.dev

- [When To Log, and When To Shut Up](https://daily.dev/posts/when-to-log-and-when-to-shut-up-7z7wzszzt) · The New Stack · 1 upvotes · 0 comments
- [Logs vs Metrics: A Practical Guide for Engineers](https://daily.dev/posts/logs-vs-metrics-a-practical-guide-for-engineers-0gj1lz5ce) · Last9 · 62 upvotes · 0 comments
- [How to structure a log](https://daily.dev/posts/how-to-structure-a-log-psj5teef9) · Sentry Engineering · 1 upvotes · 0 comments
- [Structured Logging Patterns That Actually Survive Production — Daily DevOps & .NET](https://daily.dev/posts/structured-logging-patterns-that-actually-survive-production-daily-devops-net-lphiux5cy) · Daily DevOps & .NET · 6 upvotes · 0 comments
- [Your Logs Are Lying To You](https://daily.dev/posts/your-logs-are-lying-to-you-eq23czgvl) · Hacker News · 156 upvotes · 3 comments

---

Tags: [#logging](https://daily.dev/tags/logging), [#observability](https://daily.dev/tags/observability)

[View this post on daily.dev](https://daily.dev/posts/when-and-what-should-i-be-logging--muc9vc2tm)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"When and what should I be logging?","url":"https://daily.dev/posts/when-and-what-should-i-be-logging--muc9vc2tm","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/when-and-what-should-i-be-logging--muc9vc2tm"},"datePublished":"2026-07-09T17:13:15.360Z","dateModified":"2026-07-09T17:26:36.188Z","description":"Practical guidance on logging best practices for production applications. Covers what to log (runtime decisions, algorithm outcomes, audit events, error...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/a24c3b02b321755e75e0e745807c153d?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/a24c3b02b321755e75e0e745807c153d?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Sentry Engineering","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Sentry Engineering","logo":"https://media.daily.dev/image/upload/s--qqXwMThM--/f_auto/v1710505439/logos/sentry","url":"https://daily.dev/sources/sentry"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/when-and-what-should-i-be-logging--muc9vc2tm","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"logging,observability","timeRequired":"PT9M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Sentry Engineering","item":"https://daily.dev/sources/sentry"},{"@type":"ListItem","position":3,"name":"When and what should I be logging?"}]}
```

