\HttpLog\LoggersBaseLogger

Base logger class, which serves as the backbone of other loggers.

Summary

Methods
Properties
Constants
__construct()
store_error()
__call()
is_using_default_log()
log()
debug()
info()
warning()
error()
fatal()
No public properties found
No constants found
create_log_models()
$request
$response
$log_filter
$errors
$default_log
N/A
process_filters()
map_error()
No private properties found
N/A

Properties

$log_filter

$log_filter : string

Type

string — The type of applied log filter.

$errors

$errors : array

Type

array — Error data log.

$default_log

$default_log : boolean

Type

boolean — Whether to also log all errors to PHP's default error log file.

Methods

__construct()

__construct(string  $filter, boolean  $default_log) : void

Create a base logger object.

Parameters

string $filter

Applied log filter.

boolean $default_log

Whether to also log all errors to PHP's default error log file.

store_error()

store_error(array  $error_data) : void

Store the error.

Store the error data associated with a faulty request in an error array.

Parameters

array $error_data

Error data.

__call()

__call(string  $name, array  $arguments) : void

Dynamically call custom logging.

Based on the method name (level), allow a user to manually log an error.

Parameters

string $name

Name of the called method.

array $arguments

Arguments of the called method.

is_using_default_log()

is_using_default_log() : boolean

Get "default log" setting.

Get whether to also log all errors to PHP's default error log file, in addition to the logger's custom file.

Returns

boolean —

Is default logger being used or not.

log()

log() 

Base logging function.

debug()

debug(string  $message) : void

Log a debug string.

Parameters

string $message

info()

info(string  $message) : void

Log a info string.

Parameters

string $message

warning()

warning(string  $message) : void

Log a warning.

Parameters

string $message

error()

error(string  $message) : void

Log an error.

Parameters

string $message

fatal()

fatal(string  $message) : void

Log a fatal error.

Parameters

string $message

create_log_models()

create_log_models() : void

Create log models.

Create Request and Response objects, filled with corresponding data.

process_filters()

process_filters() : array

Process filters.

Sort all filters into Request and Response filters.

Returns

array —

Sorted filter array.

map_error()

map_error(string  $name) : array

Map errors.

Map user-defined errors to their respective log levels and error codes.

Parameters

string $name

Logging level name.

Returns

array —

Log level and error code.