File
extends AbstractWriter
in package
File log writer class
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- Constructor
- getContext() : string
- Get context for log
- getFile() : string
- Get file
- getLogLimit() : int|null
- Get log limit
- getType() : string|null
- Get type
- hasLogLimit() : bool
- Has log limit
- isWithinLogLimit() : bool
- Check if a log level is within the set log level limit
- setLogLimit() : AbstractWriter
- Set log limit
- writeLog() : File
- Write to the log
Properties
$file
Log file
protected
string|null
$file
= null
$limit
Log limit
protected
int|null
$limit
= null
$type
Log file type
protected
string|null
$type
= null
Methods
__construct()
Constructor
public
__construct(string $file) : mixed
Instantiate the file writer object
Parameters
- $file : string
getContext()
Get context for log
public
getContext([array<string|int, mixed> $context = [] ]) : string
Parameters
- $context : array<string|int, mixed> = []
Return values
stringgetFile()
Get file
public
getFile() : string
Return values
stringgetLogLimit()
Get log limit
public
getLogLimit() : int|null
Return values
int|nullgetType()
Get type
public
getType() : string|null
Return values
string|nullhasLogLimit()
Has log limit
public
hasLogLimit() : bool
Return values
boolisWithinLogLimit()
Check if a log level is within the set log level limit
public
isWithinLogLimit(int $level) : bool
Parameters
- $level : int
Return values
boolsetLogLimit()
Set log limit
public
setLogLimit(int $level) : AbstractWriter
Parameters
- $level : int
Return values
AbstractWriterwriteLog()
Write to the log
public
writeLog(mixed $level, string $message[, array<string|int, mixed> $context = [] ]) : File
Parameters
- $level : mixed
- $message : string
- $context : array<string|int, mixed> = []