FileAdapter Class
Aurora\Log\Adapter Namespace
Interfaces
Traits
- T HasLevel
Properties
path
Path to the log file
protected $path = '': string
timestamp
Timestamp format
protected $timestamp = 'Y-m-d H:i:s': string
format
Log format
protected $format = '[%1$s] %2$s: %3$s': string
Constructor
__construct
Constructor
Parameters
string
$path
— Path of the log filemixed
$level
— Log level
Signature
public function __construct(string $path, mixed $level = 'debug')
Methods
__construct
Constructor
Parameters
-
string
$path
— Path of the log file -
mixed
$level
— Log level
Signature
public function __construct(string $path, mixed $level = 'debug')
setTimestamp
Set the timestamp format
Parameters
-
string
$timestamp
— Timestamp format
Return Value
$this
Signature
public function setTimestamp(string $timestamp)
setFormat
Set the log format
Parameters
-
string
$format
— Log format
Return Value
$this
Signature
public function setFormat(string $format)
log
Logs with an arbitrary level
Parameters
-
mixed
$level
— Log level -
string
$message
— Message to log
Signature
public function log(mixed $level, string $message): void