Avolutions\Logging\Logger
The Logger class writes messages with a specific level to a logfile.
Methods
Method | Visibility | Description |
---|---|---|
__construct() | public | Creates and initializes a new Logger instance. |
alert() | public | Writes the passed message with level "ALERT" to the logfile. |
critical() | public | Writes the passed message with level "CRITICAL" to the logfile. |
debug() | public | Writes the passed message with level "DEBUG" to the logfile. |
emergency() | public | Writes the passed message with level "EMERGENCY" to the logfile. |
error() | public | Writes the passed message with level "ERROR" to the logfile. |
info() | public | Writes the passed message with level "INFO" to the logfile. |
notice() | public | Writes the passed message with level "NOTICE" to the logfile. |
warning() | public | Writes the passed message with level "WARNING" to the logfile. |
Method Details
__construct()
Creates and initializes a new Logger instance.
public
__construct(string $logpath, string $logfile, string $minLogLevel, string $datetimeFormat) : mixed
Parameters
string
$logpath
Path to store logfiles.
string
$logfile
Name of the logfile.
string
$minLogLevel
Format of the log timestamp
string
$datetimeFormat
Only messages with same or higher level are logged.
alert()
Writes the passed message with level "ALERT" to the logfile.
public
alert(string $message) : mixed
Parameters
string
$message
The message to log
Return values
mixed Writes the passed message with level "ALERT" to the logfile.critical()
Writes the passed message with level "CRITICAL" to the logfile.
public
critical(string $message) : mixed
Parameters
string
$message
The message to log
Return values
mixed Writes the passed message with level "CRITICAL" to the logfile.debug()
Writes the passed message with level "DEBUG" to the logfile.
public
debug(string $message) : mixed
Parameters
string
$message
The message to log
Return values
mixed Writes the passed message with level "DEBUG" to the logfile.emergency()
Writes the passed message with level "EMERGENCY" to the logfile.
public
emergency(string $message) : mixed
Parameters
string
$message
The message to log
Return values
mixed Writes the passed message with level "EMERGENCY" to the logfile.error()
Writes the passed message with level "ERROR" to the logfile.
public
error(string $message) : mixed
Parameters
string
$message
The message to log
Return values
mixed Writes the passed message with level "ERROR" to the logfile.info()
Writes the passed message with level "INFO" to the logfile.
public
info(string $message) : mixed
Parameters
string
$message
The message to log