ClassContextLogger
final class ClassContextLogger extends AbstractLogger (View source)
PSR-3 decorator that tags every log call with the owning class's short name in the classname context key.
Methods
static LoggerInterface
for(LoggerInterface $inner, string $class)
Wrap $inner so its lines carry the short name of $class (a FQCN or self::class).
void
Details
static LoggerInterface
for(LoggerInterface $inner, string $class)
Wrap $inner so its lines carry the short name of $class (a FQCN or self::class).
A NullLogger is returned as is, and an already wrapped logger is re-tagged rather than stacked, since the outer tag is the one that reaches the line anyway.
void
log($level, Stringable|string $message, array $context = [])
No description