Logger extends FileLogger
Table of Contents
Constants
- LOG_ID = 'call.logger'
Methods
- __construct() : mixed
- create() : static|null
- Creates a logger by its ID based on .settings.php.
- getInstance() : LoggerInterface
- getSessionId() : string
- Returns current log session id.
- log() : void
- setFormatter() : $this
- Sets a formatter for the logger.
- setLevel() : $this
- Sets the maximun verbose level of the logger.
- setSessionId() : void
- Sets current log session id.
Constants
LOG_ID
public
mixed
LOG_ID
= 'call.logger'
Methods
__construct()
public
__construct(string $fileName[, int|null $maxSize = null ]) : mixed
Parameters
- $fileName : string
-
Absulute path.
- $maxSize : int|null = null
-
Maximum size of the log file.
create()
Creates a logger by its ID based on .settings.php.
public
static create(string $id[, array<string|int, mixed> $params = [] ]) : static|null
'loggers' => [ 'logger.id' => [ 'className' => 'name of the logger class', 'constructorParams' => [] OR closure, OR 'constructor' => function (...$param)}, OPTIONAL 'level' => 'verbose level', 'formatter' => 'id of formatter in service locator', ] ]
Parameters
- $id : string
-
A logger ID.
- $params : array<string|int, mixed> = []
-
An optional params to be passed to a closure in settings.
Return values
static|nullgetInstance()
public
static getInstance([string|null $logId = null ]) : LoggerInterface
Parameters
- $logId : string|null = null
Return values
LoggerInterfacegetSessionId()
Returns current log session id.
public
final static getSessionId() : string
Return values
stringlog()
public
log(mixed $level, string|Stringable $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $level : mixed
- $message : string|Stringable
- $context : array<string|int, mixed> = []
Tags
setFormatter()
Sets a formatter for the logger.
public
setFormatter(LogFormatterInterface $formatter) : $this
Parameters
- $formatter : LogFormatterInterface
Return values
$thissetLevel()
Sets the maximun verbose level of the logger.
public
setLevel(string $level) : $this
Parameters
- $level : string
-
One of LogLevel constants.
Return values
$thissetSessionId()
Sets current log session id.
public
final static setSessionId(string $sessionId) : void
Parameters
- $sessionId : string