Skip to main content

Severity reference table

The full 1-24 severity number range mapped to the six canonical severity_text buckets, plus the mapping to common host logger systems (syslog, Python logging, Go slog).

Numeric enumeration

severity_numberseverity_textPrimary aliasSyslog (RFC 5424)Python loggingGo slog
1TRACETRACE (alias TRACE1)7 (debug)
2TRACETRACE27
3TRACETRACE37
4TRACETRACE47
5DEBUGDEBUG (alias DEBUG1)710-4
6DEBUGDEBUG2710-3
7DEBUGDEBUG3710-2
8DEBUGDEBUG4710-1
9INFOINFO (alias INFO1, primary)6 (info)200
10INFOINFO26201
11INFOINFO36202
12INFOINFO46203
13WARNWARN (alias WARN1)4 (warning)304
14WARNWARN24305
15WARNWARN34306
16WARNWARN44307
17ERRORERROR (alias ERROR1)3 (err)408
18ERRORERROR23409
19ERRORERROR334010
20ERRORERROR434011
21FATALFATAL (alias FATAL1)2 (crit)5012
22FATALFATAL21 (alert)5013
23FATALFATAL30 (emerg)5014
24FATALFATAL405015

The mapping for Python logging and Go slog is approximate — those systems use coarser granularity. The dagstack-logger preserves the OTel granularity on emit, and the conversion in the table reflects what a sink would record when it forwards to a host logger system.

Canonical strings

The six values for severity_text are fixed:

"TRACE" "DEBUG" "INFO" "WARN" "ERROR" "FATAL"

Backends filter by exact match. Adding "INFO2" or "WARN_HIGH" would break exact-match queries on every observability platform.

The primary severity methods

Each binding exposes the bucket-baseline values as named methods:

Methodseverity_number
trace(...)1
debug(...)5
info(...)9
warn(...)13
error(...)17
fatal(...)21

Intermediate values (e.g., INFO2 = 10 to mark informational events at a higher numeric level than the default) go through the generic method:

logger.log(severity_number=10, body=..., attributes=...)

Source of truth

The mapping table will live in _meta/severity.yaml in the spec repository (planned for v1.1; bindings will then consume it as a vendored copy or via a git submodule and emit per-language constants from it). v1.0 bindings ship the table inline; once the YAML lands a binding that still hard-codes the values is not conformant — drift between the spec and the binding surfaces as production divergence.

See also