OpenTelemetry PHP

Severity : int
in package

Table of Contents

Cases

DEBUG  = 5
DEBUG2  = 6
DEBUG3  = 7
DEBUG4  = 8
ERROR  = 17
ERROR2  = 18
ERROR3  = 19
ERROR4  = 20
FATAL  = 21
FATAL2  = 22
FATAL3  = 23
FATAL4  = 24
INFO  = 9
INFO2  = 10
INFO3  = 11
INFO4  = 12
TRACE  = 1
TRACE2  = 2
TRACE3  = 3
TRACE4  = 4
WARN  = 13
WARN2  = 14
WARN3  = 15
WARN4  = 16

Methods

fromName()  : self
Resolves a case-insensitive case name, as used by the `SeverityNumber` config enum.
fromPsr3()  : self
Maps PSR-3 severity level (string) to the appropriate opentelemetry severity
toPsr3()  : "debug"|"info"|"notice"|"warning"|"error"|"critical"|"alert"|"emergency"
Maps to a PSR-3 level, inverting {@see self::fromPsr3()}.

Cases

Methods

fromName()

Resolves a case-insensitive case name, as used by the `SeverityNumber` config enum.

public static fromName(string $name) : self
Parameters
$name : string
Return values
self

toPsr3()

Maps to a PSR-3 level, inverting {@see self::fromPsr3()}.

public toPsr3() : "debug"|"info"|"notice"|"warning"|"error"|"critical"|"alert"|"emergency"

PSR-3's levels are the RFC 5424 severities, which the spec's example mappings pin to particular cases: Notice to INFO2, Critical to ERROR2, Alert to ERROR3, Emergency to FATAL. Nothing is pinned to the remaining numbered cases, so each maps to the nearest pinned case at or below it. Mapping down rather than up keeps the result monotonic, which matters where the level is a threshold: INFO3 outranks INFO2, so it must not map to a more verbose PSR-3 level than INFO2 does. The trade is that a threshold may admit slightly more than asked for, never less.

Tags
see
https://github.com/open-telemetry/opentelemetry-specification/blob/v1.61.0/specification/logs/data-model-appendix.md#appendix-b-severitynumber-example-mappings
Return values
"debug"|"info"|"notice"|"warning"|"error"|"critical"|"alert"|"emergency"
On this page

Search results