OpenTelemetry PHP

Logging
in package

Logging utility functions for internal logging (of OpenTelemetry errors/warnings etc).

This is not part of SDK configuration to avoid creating a dependency on SDK from any package which does logging.

Tags
todo

this should be @internal, but deptrac is not happy with that.

Table of Contents

Constants

DEFAULT_LEVEL  = \Psr\Log\LogLevel::INFO
LEVELS  = [\Psr\Log\LogLevel::DEBUG, \Psr\Log\LogLevel::INFO, \Psr\Log\LogLevel::NOTICE, \Psr\Log\LogLevel::WARNING, \Psr\Log\LogLevel::ERROR, \Psr\Log\LogLevel::CRITICAL, \Psr\Log\LogLevel::ALERT, \Psr\Log\LogLevel::EMERGENCY, self::NONE]
NONE  = 'none'
OTEL_LOG_LEVEL  = 'OTEL_LOG_LEVEL'

Properties

$logLevel  : int|null
The minimum log level. Messages with lower severity than this will be ignored.
$writer  : LogWriterInterface|null

Methods

disable()  : void
level()  : int
Get level priority from level name
logLevel()  : int
Get defined OTEL_LOG_LEVEL, or default
logWriter()  : LogWriterInterface
reset()  : void
setLogWriter()  : void
getLogLevel()  : int

Constants

DEFAULT_LEVEL

private mixed DEFAULT_LEVEL = \Psr\Log\LogLevel::INFO

LEVELS

private mixed LEVELS = [\Psr\Log\LogLevel::DEBUG, \Psr\Log\LogLevel::INFO, \Psr\Log\LogLevel::NOTICE, \Psr\Log\LogLevel::WARNING, \Psr\Log\LogLevel::ERROR, \Psr\Log\LogLevel::CRITICAL, \Psr\Log\LogLevel::ALERT, \Psr\Log\LogLevel::EMERGENCY, self::NONE]

OTEL_LOG_LEVEL

private mixed OTEL_LOG_LEVEL = 'OTEL_LOG_LEVEL'

Properties

$logLevel

The minimum log level. Messages with lower severity than this will be ignored.

private static int|null $logLevel = null

Methods

disable()

public static disable() : void

level()

Get level priority from level name

public static level(string $level) : int
Parameters
$level : string
Return values
int

logLevel()

Get defined OTEL_LOG_LEVEL, or default

public static logLevel() : int
Return values
int

reset()

public static reset() : void

getLogLevel()

private static getLogLevel() : int
Return values
int

        
On this page

Search results