Jelix 1.7.18

jLogErrorMessage
in package
implements jILogMessage

this class is formatting an error message for a logger.

Interfaces, Classes and Traits

jILogMessage
interface for log message. A component which want to log a message can use an object implementing this interface.

Table of Contents

$category  : mixed
$code  : mixed
$file  : mixed
$format  : mixed
$line  : mixed
$message  : mixed
$trace  : mixed
__construct()  : mixed
getCategory()  : string
return the category of the message.
getCode()  : string
getFile()  : string
getFormatedMessage()  : string
return the full message, formated for simple text output (it can contain informations other than the message itself).
getLine()  : int
getMessage()  : string
getTrace()  : array<string|int, mixed>
setFormat()  : mixed
set the pattern to format the message output.
sanitizeParams()  : mixed

Properties

$format

protected mixed $format = '%date%\t%ip%\t[%code%]\t%msg%\t%file%\t%line%\n\t%url%\n%params%\n%trace%'

Methods

__construct()

public __construct(string $category, int $code, string $message, string $file, int $line, array<string|int, mixed> $trace) : mixed
Parameters
$category : string

category of the message (error, warning...)

$code : int

error code

$message : string

error message

$file : string

file path + file name where the error appeared

$line : int

the line where the error appeared

$trace : array<string|int, mixed>

stack trace

Return values
mixed

getCategory()

return the category of the message.

public getCategory() : string
Return values
string

category of the message (error, warning...)

getFile()

public getFile() : string
Return values
string

file path + file name where the error appeared

getFormatedMessage()

return the full message, formated for simple text output (it can contain informations other than the message itself).

public getFormatedMessage() : string
Return values
string

formated error message

getTrace()

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

the stack trace

setFormat()

set the pattern to format the message output.

public setFormat(string $format) : mixed
Parameters
$format : string
Return values
mixed

sanitizeParams()

protected sanitizeParams(mixed $params) : mixed
Parameters
$params : mixed
Return values
mixed

Search results