Documentation

T4LOG
in package
implements LoggerInterface

FinalYes

Table of Contents

Interfaces

LoggerInterface

Constants

PRIORITY_ALERT  : 1 = LOG_ALERT
PRIORITY_CRIT  : 2 = 2
PRIORITY_DEBUG  : 40 = 40
PRIORITY_DEFAULT  : 1 = LOG_ALERT
PRIORITY_DEV  : 44 = 44
PRIORITY_EMERG  : 0 = 0
PRIORITY_ERR  : 4 = LOG_ERR
PRIORITY_INFO  : 3 = 3
PRIORITY_NORMAL  : 6 = LOG_NOTICE
PRIORITY_NOTICE  : 6 = LOG_NOTICE
PRIORITY_WARNING  : 5 = LOG_WARNING

Properties

$LOG_ROOT_DEV_DIR  : string
$LOG_ROOT_DIR  : string
$after  : string
$before  : string
$logFileDevScheme  : string
$logFileScheme  : string
$logScheme  : string
$message  : string
$sepparator  : string
$startScheme  : string
$stopScheme  : string
$datetime  : string
$datetimeFile  : string
$nameLogFile  : string
$nameLogFileT4LOG  : string
$params  : array<string|int, mixed>
$priority  : int
$systemLog  : bool|string
$systemLogSocket  : mixed

Methods

__construct()  : mixed
__destruct()  : mixed
alert()  : void
Logs with an arbitrary level.
crit()  : void
Logs with an arbitrary level.
critical()  : void
Logs with an arbitrary level.
debug()  : void
Logs with an arbitrary level.
dev()  : void
Logs with an arbitrary level.
emerg()  : void
Logs with an arbitrary level.
emergency()  : void
Logs with an arbitrary level.
err()  : void
Logs with an arbitrary level.
error()  : void
Logs with an arbitrary level.
getDatetime()  : mixed
getLogScheme()  : string
getMessage()  : string
getParams()  : array<string|int, mixed>
info()  : void
Logs with an arbitrary level.
log()  : void
Logs with an arbitrary level.
logT()  : T4LOG
notice()  : void
Logs with an arbitrary level.
on()  : void
setDatetime()  : T4LOG
setLogScheme()  : T4LOG
setMessage()  : T4LOG
setParams()  : T4LOG
setStartScheme()  : T4LOG
setStopScheme()  : T4LOG
sys()  : void
Logs with an arbitrary level.
warning()  : void
Logs with an arbitrary level.
contextParse()  : string
paramParse()  : string|bool
priorityParse()  : string
saveLog()  : bool
validatePriority()  : bool
filterFillName()  : string
Filters special characters from a file name or path.
santanizeFileName()  : string
t4LOGLooger()  : bool
Logs application start/stop events to the specified log file.

Constants

PRIORITY_ALERT

public 1 PRIORITY_ALERT = LOG_ALERT
Tags
readonly

PRIORITY_CRIT

public 2 PRIORITY_CRIT = 2
Tags
readonly
default

LOG_CRIT

PRIORITY_DEBUG

public 40 PRIORITY_DEBUG = 40
Tags
readonly

PRIORITY_DEFAULT

public 1 PRIORITY_DEFAULT = LOG_ALERT
Tags
readonly

PRIORITY_DEV

public 44 PRIORITY_DEV = 44
Tags
readonly

PRIORITY_EMERG

public 0 PRIORITY_EMERG = 0
Tags
readonly
default

LOG_EMERG

PRIORITY_ERR

public 4 PRIORITY_ERR = LOG_ERR
Tags
readonly

PRIORITY_INFO

public 3 PRIORITY_INFO = 3
Tags
readonly

PRIORITY_NORMAL

public 6 PRIORITY_NORMAL = LOG_NOTICE
Tags
readonly

PRIORITY_NOTICE

public 6 PRIORITY_NOTICE = LOG_NOTICE
Tags
readonly

PRIORITY_WARNING

public 5 PRIORITY_WARNING = LOG_WARNING
Tags
readonly

Properties

$LOG_ROOT_DEV_DIR

public static string $LOG_ROOT_DEV_DIR = "dev{{DIRECTORY_SEPARATOR}}"

$LOG_ROOT_DIR

public static string $LOG_ROOT_DIR = __DIR__ . "..{{DIRECTORY_SEPARATOR}}..{{DIRECTORY_SEPARATOR}}runtime{{DIRECTORY_SEPARATOR}}log{{DIRECTORY_SEPARATOR}}"

$after

protected string $after = ""

$before

protected string $before = ""

$logFileDevScheme

protected string $logFileDevScheme = "{{date_file}}_{{php_version}}.t4log"

$logFileScheme

protected string $logFileScheme = "{{date_file}}_{{php_version}}.log"

$logScheme

protected string $logScheme = "{{datetime}} {{sepparator}} [{{prefix}}] {{before}} {{message}} {{after}} {{sepparator}} {{file}}::{{line}}" . " |{{ip}}| {{sepparator}} {{php_version}} {{sepparator}} {{system_user}}/{{os}}/{{os_family}}"

$message

protected string $message = "APP:LOG >>"

$sepparator

protected string $sepparator = "-"

$startScheme

protected string $startScheme = "{{datetime}} {{sepparator}} [{{prefix}}][START:APP] {{before}} {{message}} {{after}} {{sepparator}} " . "{{php_version}}::{{php_version_id}} {{sepparator}} {{system_user}}/{{os}}/{{os_family}} {{sepparator}} " . "{{php_config_file_path}} {{pear_install_dir}}"

$stopScheme

protected string $stopScheme = "{{datetime}} {{sepparator}} [{{prefix}}][STOP:APP] {{before}} {{message}} {{after}} {{sepparator}} " . "{{php_version}}::{{php_version_id}} {{sepparator}} {{system_user}}/{{os}}/{{os_family}} {{sepparator}} " . "{{php_config_file_path}} {{pear_install_dir}}"

$datetime

private string $datetime = DATE_ATOM

$datetimeFile

private string $datetimeFile = "d_m_Y"

$nameLogFile

private string $nameLogFile

$nameLogFileT4LOG

private string $nameLogFileT4LOG

$params

private array<string|int, mixed> $params = []

$priority

private int $priority = self::PRIORITY_DEFAULT

$systemLog

private bool|string $systemLog = false

$systemLogSocket

private mixed $systemLogSocket

Methods

__construct()

public __construct([array<string|int, mixed> $params = [] ]) : mixed
Parameters
$params : array<string|int, mixed> = []

__destruct()

public __destruct() : mixed

alert()

Logs with an arbitrary level.

public alert(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []

crit()

Logs with an arbitrary level.

public crit(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []

critical()

Logs with an arbitrary level.

public critical(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []

debug()

Logs with an arbitrary level.

public debug(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []

dev()

Logs with an arbitrary level.

public dev(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []

emerg()

Logs with an arbitrary level.

public emerg(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []

emergency()

Logs with an arbitrary level.

public emergency(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []

err()

Logs with an arbitrary level.

public err(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []

error()

Logs with an arbitrary level.

public error(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []

getDatetime()

public getDatetime() : mixed

getLogScheme()

public getLogScheme() : string
Return values
string

getMessage()

public getMessage() : string
Return values
string

getParams()

public getParams() : array<string|int, mixed>
Return values
array<string|int, mixed>

info()

Logs with an arbitrary level.

public info(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []

log()

Logs with an arbitrary level.

public log(int $level, string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$level : int
$message : string
$context : array<string|int, mixed> = []

logT()

public logT(int $priority, string $message) : T4LOG
Parameters
$priority : int
$message : string
Return values
T4LOG

notice()

Logs with an arbitrary level.

public notice(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []

on()

public on(int $priority, string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$priority : int
$message : string
$context : array<string|int, mixed> = []

setDatetime()

public setDatetime(mixed $datetime) : T4LOG
Parameters
$datetime : mixed
Return values
T4LOG

setLogScheme()

public setLogScheme(string $logScheme) : T4LOG
Parameters
$logScheme : string
Return values
T4LOG

setMessage()

public setMessage(string $message) : T4LOG
Parameters
$message : string
Return values
T4LOG

setParams()

public setParams(array<string|int, mixed> $params) : T4LOG
Parameters
$params : array<string|int, mixed>
Return values
T4LOG

setStartScheme()

public setStartScheme(string $startScheme) : T4LOG
Parameters
$startScheme : string
Return values
T4LOG

setStopScheme()

public setStopScheme(string $stopScheme) : T4LOG
Parameters
$stopScheme : string
Return values
T4LOG

sys()

Logs with an arbitrary level.

public sys(int $facility, string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$facility : int
$message : string
$context : array<string|int, mixed> = []

The facility argument is used to specify what type of program is logging the message. This lets the configuration file specify that messages from different facilities will be handled differently. Must be one of the following constants:

  • LOG_AUTH
  • LOG_AUTHPRIV
  • LOG_CRON
  • LOG_DAEMON
  • LOG_KERN
  • LOG_LOCAL[0-7]
  • LOG_LPR
  • LOG_MAIL
  • LOG_NEWS
  • LOG_SYSLOG
  • LOG_USER
  • LOG_UUCP Note : This parameter is ignored on Windows.

warning()

Logs with an arbitrary level.

public warning(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []

contextParse()

protected contextParse(string $scheme, array<string|int, mixed>|object $context) : string
Parameters
$scheme : string
$context : array<string|int, mixed>|object
Return values
string

paramParse()

protected paramParse(mixed $log[, int|null $priority = null ][, string|null $message = null ]) : string|bool
Parameters
$log : mixed
$priority : int|null = null
$message : string|null = null
Return values
string|bool

priorityParse()

protected priorityParse([int|null $priority = null ]) : string
Parameters
$priority : int|null = null
Return values
string

saveLog()

protected saveLog(int $priority, string $message[, array<string|int, mixed> $context = [] ][, string|null $scheme = null ][, bool|null $stering = null ][, bool $nativeSystemLog = false ]) : bool
Parameters
$priority : int
$message : string
$context : array<string|int, mixed> = []
$scheme : string|null = null
$stering : bool|null = null
$nativeSystemLog : bool = false
Return values
bool

validatePriority()

protected validatePriority([int|null $priority = null ]) : bool
Parameters
$priority : int|null = null
Return values
bool

filterFillName()

Filters special characters from a file name or path.

private filterFillName(string $raw) : string

This function removes or replaces characters that are not safe for use in file systems. It's designed to prevent potential issues with file creation or access due to invalid characters.

Parameters
$raw : string

The input string (file name or path) to be filtered.

Return values
string

The filtered string, safe for use as a file name or path component.

santanizeFileName()

private santanizeFileName(string $raw) : string
Parameters
$raw : string
Return values
string

t4LOGLooger()

Logs application start/stop events to the specified log file.

private t4LOGLooger(string $EGV) : bool
Parameters
$EGV : string

The event type, e.g., "START" or "STOP".

Return values
bool

True on success, false on failure.

On this page

Search results