DEBUG
DEBUG = 100
Detailed debug information
Monolog log channel
It contains a stack of Handlers and a stack of Processors, and uses them to store records that are added to it.
$levels : array<int,string>
This is a static variable and not a constant to serve as an extension point for custom levels
$name : string
$handlers : \Monolog\Handler\HandlerInterface[]
The handler stack
$processors : callable[]
Processors that will process all log records
To process records of a single handler instead, add the processor on that specific handler
$microsecondTimestamps : bool
$exceptionHandler : callable|null
$logDepth : int
$fiberLogDepth : \WeakMap<\Fiber,int>|null
$detectCycles : bool
__construct(string $name, \Monolog\Handler\HandlerInterface[] $handlers = [], callable[] $processors = [], \DateTimeZone|null $timezone = null) : mixed
string | $name | The logging channel, a simple descriptive name that is attached to all log records |
\Monolog\Handler\HandlerInterface[] | $handlers | Optional stack of handlers, the first one in the array is called first, etc. |
callable[] | $processors | Optional array of processors |
\DateTimeZone|null | $timezone | Optional timezone, if not provided date_default_timezone_get() will be used |
useMicrosecondTimestamps(bool $micro) : self
Control the use of microsecond resolution timestamps in the 'datetime' member of new records.
As of PHP7.1 microseconds are always included by the engine, so there is no performance penalty and Monolog 2 enabled microseconds by default. This function lets you disable them though in case you want to suppress microseconds from the output.
bool | $micro | True to use microtime() to create timestamps |
addRecord(int $level, string $message, array $context = [], \Monolog\DateTimeImmutable $datetime = null) : bool
Adds a log record.
int | $level | The logging level (a Monolog or RFC 5424 level) |
string | $message | The log message |
array | $context | The log context |
\Monolog\DateTimeImmutable | $datetime | Optional log date to log into the past or future |
Whether the record has been processed
close() : void
Ends a log cycle and frees all resources used by handlers.
Closing a Handler means flushing all buffers and freeing any open resources/handles. Handlers that have been closed should be able to accept log records again and re-open themselves on demand, but this may not always be possible depending on implementation.
This is useful at the end of a request and will be called automatically on every handler when they get destructed.
reset() : void
Ends a log cycle and resets all handlers and processors to their initial state.
Resetting a Handler or a Processor means flushing/cleaning all buffers, resetting internal state, and getting it back to a state in which it can receive log records again.
This is useful in case you want to avoid logs leaking between two requests or jobs when you have a long running process like a worker or an application server serving multiple requests in one process.
log(mixed $level, string|\Stringable $message, array $context = []) : void
Adds a log record at an arbitrary level.
This method allows for compatibility with common interfaces.
mixed | $level | The log level (a Monolog, PSR-3 or RFC 5424 level) |
string|\Stringable | $message | The log message |
array | $context | The log context |