Logger
class Logger
Class Logger
Constants
| DEBUG |
|
| INFO |
|
| NOTICE |
|
| WARNING |
|
| ERROR |
|
| CRITICAL |
|
| ALERT |
|
| EMERGENCY |
|
| CLI_LEVEL_COLOR |
|
| FRONTEND_LEVEL_COLOR |
|
Properties
| static protected Logger | $logger | ||
| static protected HandlerInterface[] | $handlers | ||
| static protected array | $stats | ||
| static protected ArrayObject | $inMemoryLogs | ||
| static protected Closure[] | $deferredSetups | ||
| static protected array | $deferredLogs | ||
| static protected array | $lastLogEntry | ||
| static protected array | $context | Global context data used by all stream handlers. |
Methods
No description
Adds the given handler. The handler starts the logging immanently.
No description
Close an active handler.
No description
No description
No description
No description
Returns the log level defined in XF_LOG_LEVEL
No description
Returns the last logged entry
No description
No description
No description
No description
Setup the logger with static configuration defined at XELOS\Config\LOGGER.
No description
Ends a log cycle and resets all handlers and processors to their initial state.
Setup the Logger by invoke each stream handler factory and adds the created handler as active stream to this logger.
Translates default PHP log levels into PSR / Monolog levels.
No description
Details
at line 321
static void
addContext(array $context)
No description
at line 225
static protected void
addHandler(HandlerInterface $handler, string|null $name = null)
Adds the given handler. The handler starts the logging immanently.
at line 576
static void
alert(string $message, array $context = [], string|null $file = null, int|null $line = null)
No description
at line 201
static void
closeHandler(string $name)
Close an active handler.
Ends a log cycle and frees all resources used by the handler. Closing a Handler means flushing all buffers and freeing any open resources/handles.
at line 536
static void
critical(string $message, array $context = [], string|null $file = null, int|null $line = null)
No description
at line 566
static void
debug(string $message, array $context = [], string|null $file = null, int|null $line = null)
No description
at line 546
static void
emergency(string $message, array $context = [], string|null $file = null, int|null $line = null)
No description
at line 506
static void
error(string $message, array $context = [], string|null $file = null, int|null $line = null)
No description
at line 481
static void
exception(Throwable $exception, string $message = '', string $level = Logger::ERROR, array $context = [])
No description
at line 243
static string
getDefaultLevel()
Returns the log level defined in XF_LOG_LEVEL
at line 336
static ArrayObject
getInMemoryLogs()
No description
at line 344
static array
getLastLogEntry($level)
Returns the last logged entry
at line 329
static array
getStats()
No description
at line 495
static void
handleException(Throwable $exception)
No description
at line 516
static void
info(string $message, array $context = [], string|null $file = null, int|null $line = null)
No description
at line 252
static bool
isDefaultLevel($level)
No description
at line 355
static void
log(string $level, string $message, array $context = [], string|null $file = null, int|null $line = null)
No description
at line 97
static void
namedSetup(string $name)
Setup the logger with static configuration defined at XELOS\Config\LOGGER.
at line 556
static void
notice(string $message, array $context = [], string|null $file = null, int|null $line = null)
No description
at line 469
static void
reset()
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.
at line 148
static void
setup(array $streamFactories)
Setup the Logger by invoke each stream handler factory and adds the created handler as active stream to this logger.
at line 263
static string
translateLevel($level)
Translates default PHP log levels into PSR / Monolog levels.
at line 526
static void
warning(string $message, array $context = [], string|null $file = null, int|null $line = null)
No description