TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
LogRecord Class Reference
Inheritance diagram for LogRecord:

Public Member Functions

 __construct ($component= '', $level, $message, array $data=[])
 
 setComponent ($component)
 
 getComponent ()
 
 setCreated ($created)
 
 getCreated ()
 
 setLevel ($level)
 
 getLevel ()
 
 setData ($data)
 
 getData ()
 
 addData (array $data)
 
 setMessage ($message)
 
 getMessage ()
 
 setRequestId ($requestId)
 
 getRequestId ()
 
 __toString ()
 
 toArray ()
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 

Protected Attributes

 $requestId = ''
 
 $created = 0.0
 
 $component = ''
 
 $level = LogLevel::INFO
 
 $message = ''
 
 $data = []
 

Private Attributes

 $gettableProperties
 
 $settableProperties
 

Detailed Description

Log record

Definition at line 22 of file LogRecord.php.

Constructor & Destructor Documentation

__construct (   $component = '',
  $level,
  $message,
array  $data = [] 
)

Constructor.

Parameters
string$componentAffected component
int$levelSeverity level (see )
string$messageLog message
array$dataAdditional data

Definition at line 99 of file LogRecord.php.

References LogRecord\$component, LogRecord\$data, LogRecord\$level, LogRecord\$message, Bootstrap\getInstance(), LogRecord\getRequestId(), and LogRecord\setRequestId().

Member Function Documentation

__toString ( )

Convert record to string for simple output, like echo(). Contents of data array is appended as JSON-encoded string

Returns
string

Definition at line 263 of file LogRecord.php.

References LogRecord\$data, and LogLevel\getName().

addData ( array  $data)

Adds additional log data to already existing data and overwrites previously data using the same array keys.

Parameters
array$data
Returns

Definition at line 207 of file LogRecord.php.

Referenced by IntrospectionProcessor\processLogRecord().

getComponent ( )

Returns the component

Returns
string Component key

Definition at line 126 of file LogRecord.php.

References LogRecord\$component.

Referenced by SyslogWriter\getMessageForSyslog(), PhpErrorLogWriter\writeLog(), DatabaseWriter\writeLog(), and FileWriter\writeLog().

getCreated ( )

Returns the creation time

Returns
float Creation time as float

Definition at line 148 of file LogRecord.php.

References LogRecord\$created.

Referenced by DatabaseWriter\writeLog(), and FileWriter\writeLog().

getData ( )

Returns the log data

Returns
array

Definition at line 195 of file LogRecord.php.

References LogRecord\$data.

Referenced by SyslogWriter\getMessageForSyslog(), PhpErrorLogWriter\writeLog(), DatabaseWriter\writeLog(), and FileWriter\writeLog().

getLevel ( )

Returns the severity level

See also
Returns
int Severity level

Definition at line 173 of file LogRecord.php.

References LogRecord\$level.

Referenced by Logger\callProcessors(), PhpErrorLogWriter\writeLog(), DatabaseWriter\writeLog(), FileWriter\writeLog(), SyslogWriter\writeLog(), and Logger\writeLog().

getMessage ( )

Returns the log message

Returns
string Log message

Definition at line 230 of file LogRecord.php.

References LogRecord\$message.

Referenced by SyslogWriter\getMessageForSyslog(), PhpErrorLogWriter\writeLog(), DatabaseWriter\writeLog(), and FileWriter\writeLog().

getRequestId ( )
offsetExists (   $offset)

Checks whether an offset exists, required by ArrayAccess interface

Parameters
mixed$offset
Returns
bool

Definition at line 311 of file LogRecord.php.

offsetGet (   $offset)

Offset to retrieve, required by ArrayAccess interface

Parameters
mixed$offset
Returns
mixed

Definition at line 326 of file LogRecord.php.

offsetSet (   $offset,
  $value 
)

Offset to set, required by ArrayAccess interface

Parameters
mixed$offset
mixed$value
Returns
void

Definition at line 341 of file LogRecord.php.

offsetUnset (   $offset)

Offset to unset, required by ArrayAccess interface

Parameters
mixed$offset
Returns
void

Definition at line 354 of file LogRecord.php.

setComponent (   $component)

Sets the affected component

Parameters
string$componentComponent key
Returns

Definition at line 115 of file LogRecord.php.

References LogRecord\$component.

setCreated (   $created)

Sets the the creation time

Parameters
float$createdCreation time as float
Returns

Definition at line 137 of file LogRecord.php.

References LogRecord\$created.

setData (   $data)

Sets log data array

Parameters
array$data
Returns

Definition at line 184 of file LogRecord.php.

References LogRecord\$data.

setLevel (   $level)

Sets the severity level

Parameters
int$levelSeverity level
Returns
See also

Definition at line 160 of file LogRecord.php.

References LogRecord\$level, and LogLevel\validateLevel().

setMessage (   $message)

Sets the log message

Parameters
string | object$messageLog message. Usually a string, or an object that can be casted to string (implements __toString())
Returns

Definition at line 219 of file LogRecord.php.

References LogRecord\$message.

setRequestId (   $requestId)

Sets the request ID

Parameters
string$requestId
Returns

Definition at line 241 of file LogRecord.php.

References LogRecord\$requestId.

Referenced by LogRecord\__construct().

toArray ( )

Convert record to array

Returns
array

Definition at line 293 of file LogRecord.php.

References LogRecord\$component, LogRecord\$created, LogRecord\$data, LogRecord\$level, LogRecord\$message, and LogRecord\$requestId.

Member Data Documentation

$component = ''
protected
$created = 0.0
protected

Definition at line 36 of file LogRecord.php.

Referenced by LogRecord\getCreated(), LogRecord\setCreated(), and LogRecord\toArray().

$data = []
protected
$gettableProperties
private
Initial value:
= [
'requestId',
'created',
'component',
'level',
'message',
'data'
]

Definition at line 71 of file LogRecord.php.

$level = LogLevel::INFO
protected
$message = ''
protected
$requestId = ''
protected

Definition at line 29 of file LogRecord.php.

Referenced by LogRecord\getRequestId(), LogRecord\setRequestId(), and LogRecord\toArray().

$settableProperties
private
Initial value:
= [
'level',
'message',
'data'
]

Definition at line 85 of file LogRecord.php.