# How to structure a log

DevFeed: [How to structure a log](<https://devfeed.tech/articles/how-to-structure-a-log-24114.md>)

Original publisher: [Read original article](<https://blog.sentry.io/structure-a-log/>)

Author: Kyle Tryon

Published: 2026-07-21T09:00:00Z

Content type: tutorial

Language: en

Sources: [Sentry Blog](<https://devfeed.tech/sources/sentry-blog.md>)

Topics: [Logging](<https://devfeed.tech/topics/logging.md>), [Structured-data](<https://devfeed.tech/topics/structured-data.md>), [TypeScript](<https://devfeed.tech/topics/typescript.md>), [ESLint](<https://devfeed.tech/topics/eslint.md>), [SIEM, Security, Observability](<https://devfeed.tech/topics/siem-security-observability.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [guide](<https://devfeed.tech/tags/guide.md>), [lint](<https://devfeed.tech/tags/lint.md>), [logs](<https://devfeed.tech/tags/logs.md>), [programming](<https://devfeed.tech/tags/programming.md>), [schema](<https://devfeed.tech/tags/schema.md>)

## AI overview

A practical guide to writing structured logs that are consistent, queryable, and useful for debugging in production. It covers event naming, flattened attributes, predictable low-cardinality values, severity levels, primitive-value constraints, and enforcing conventions with an ESLint plugin for TypeScript.

## Source excerpt

A practical guide to writing structured, queryable, lint-enforceable logs with consistent event names, attributes, severity, and schema checks.