logo

Vedatrace

Php sdk

API Reference

Detailed API reference for the VedaTrace PHP SDK classes and methods.

The VedaTrace PHP SDK provides a lean set of classes for logging and configuration.

VedaTrace\VedaTrace

Factory class for creating VedaTrace loggers.

MethodSignatureDescription
createcreate(array $config = []): LoggerCreate a new logger instance with the given configuration.

VedaTrace\Logger

The main logging class implementing Psr\Log\LoggerInterface.

MethodSignatureDescription
loglog($level, $message, array $context = []): voidLog a message at the given level.
debugdebug($message, array $context = []): voidLog a message at the debug level.
infoinfo($message, array $context = []): voidLog a message at the info level.
warnwarn($message, array $context = []): voidLog a message at the warn level.
errorerror($message, array $context = []): voidLog a message at the error level.
fatalfatal($message, array $context = []): voidLog a message at the fatal level.
childchild(array $context): LoggerCreate a child logger with additional context.
flushflush(): voidManually flush any buffered log entries.
disposedispose(): voidFlush the buffer and disable the logger.

VedaTrace\Config

Handles configuration values and environment variables.

MethodSignatureDescription
getget(string $key, $default = null): mixedGet a configuration value by key.

Interoperability

The VedaTrace PHP SDK is built on standard PHP interfaces, including PSR-3 for logging and Guzzle for HTTP transport, ensuring high compatibility with modern PHP applications and frameworks.

On this page