FileLogger
in package
implements
LoggerInterface
Interfaces, Classes, Traits and Enums
- LoggerInterface
Table of Contents
- $logFile : mixed
- __construct() : mixed
- Constructor to initialize the log file path.
- alert() : void
- Action must be taken immediately.
- critical() : void
- Critical conditions.
- debug() : void
- Detailed debug information.
- emergency() : void
- System is unusable.
- error() : void
- Runtime errors that do not require immediate action but should be logged and monitored.
- info() : void
- Interesting events.
- log() : void
- Logs with an arbitrary level.
- notice() : void
- Normal but significant events.
- warning() : void
- Exceptional occurrences that are not errors.
- interpolate() : string
- Replace placeholders in message with context data.
Properties
$logFile
private
mixed
$logFile
Methods
__construct()
Constructor to initialize the log file path.
public
__construct([null|string $logFile = null ]) : mixed
If no file is provided, it falls back to error_log().
Parameters
- $logFile : null|string = null
-
The file where logs will be stored. If null, uses error_log.
Return values
mixed —alert()
Action must be taken immediately.
public
alert(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
Return values
void —critical()
Critical conditions.
public
critical(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
Return values
void —debug()
Detailed debug information.
public
debug(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
Return values
void —emergency()
System is unusable.
public
emergency(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
Return values
void —error()
Runtime errors that do not require immediate action but should be logged and monitored.
public
error(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
Return values
void —info()
Interesting events.
public
info(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
Return values
void —log()
Logs with an arbitrary level.
public
log(mixed $level, string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $level : mixed
- $message : string
- $context : array<string|int, mixed> = []
Tags
Return values
void —notice()
Normal but significant events.
public
notice(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
Return values
void —warning()
Exceptional occurrences that are not errors.
public
warning(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
Return values
void —interpolate()
Replace placeholders in message with context data.
private
interpolate(string $message[, array<string|int, mixed> $context = [] ]) : string
Parameters
- $message : string
- $context : array<string|int, mixed> = []