Logger
Log class used for debug and exception logging.
Tags
Table of Contents
- $classname : string
- The name of the class that this Logger is logging for.
- $debugClasses : array<string|int, mixed>
- An array of class names that will be logged at debug level, regardless of the global Logger::level setting.
- $level : string
- The logging level applied accross the system. Valid options are DEBUG, INFO, WARN, ERROR, FATAL, and SQL.
- $logProvider : LogProviderFile
- The log file the log entries will be saved to.
- $request : Request
- A request object that will give us the IP, user-agent etc. of the client we are logging for.
- __construct() : mixed
- The constructor.
- action() : mixed
- Log an action carried out by a person to the ActionLog table.
- debug() : mixed
- Log a DEBUG message.
- error() : mixed
- Log an ERROR message.
- fatal() : mixed
- Log a FATAL message.
- info() : mixed
- Log an INFO message.
- notifyAdmin() : mixed
- Notify the sys admin via email when a serious error occurs.
- setLogProviderFile() : mixed
- Allows you to set the log file path to one other than the main application log.
- sql() : mixed
- Log a SQL queries.
- warn() : mixed
- Log a WARN message.
Properties
$classname
The name of the class that this Logger is logging for.
private
string
$classname
Tags
$debugClasses
An array of class names that will be logged at debug level, regardless of the global Logger::level setting.
private
array<string|int, mixed>
$debugClasses
= array()
Tags
$level
The logging level applied accross the system. Valid options are DEBUG, INFO, WARN, ERROR, FATAL, and SQL.
private
string
$level
Tags
$logProvider
The log file the log entries will be saved to.
private
LogProviderFile
$logProvider
Tags
$request
A request object that will give us the IP, user-agent etc. of the client we are logging for.
private
Request
$request
Tags
Methods
__construct()
The constructor.
public
__construct(string $classname) : mixed
Parameters
- $classname : string
Tags
Return values
mixed —action()
Log an action carried out by a person to the ActionLog table.
public
action(string $message) : mixed
Parameters
- $message : string
Tags
Return values
mixed —debug()
Log a DEBUG message.
public
debug(string $message) : mixed
Parameters
- $message : string
Tags
Return values
mixed —error()
Log an ERROR message.
public
error(string $message) : mixed
Parameters
- $message : string
Tags
Return values
mixed —fatal()
Log a FATAL message.
public
fatal(string $message) : mixed
Parameters
- $message : string
Tags
Return values
mixed —info()
Log an INFO message.
public
info(string $message) : mixed
Parameters
- $message : string
Tags
Return values
mixed —notifyAdmin()
Notify the sys admin via email when a serious error occurs.
public
notifyAdmin(string $message) : mixed
Parameters
- $message : string
Tags
Return values
mixed —setLogProviderFile()
Allows you to set the log file path to one other than the main application log.
public
setLogProviderFile(string $filepath) : mixed
Parameters
- $filepath : string
Tags
Return values
mixed —sql()
Log a SQL queries.
public
sql(string $message) : mixed
Parameters
- $message : string
Tags
Return values
mixed —warn()
Log a WARN message.
public
warn(string $message) : mixed
Parameters
- $message : string