public function append($message, $severity = LOG_INFO, $additionalData = null, $packageKey = null, $className = null, $methodName = null)
{
if ($severity > $this->severityThreshold) {
return;
}
if (function_exists('posix_getpid')) {
$processId = ' ' . str_pad(posix_getpid(), 10);
} else {
$processId = ' ';
}
$ipAddress = $this->logIpAddress === true ? str_pad(isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '', 15) : '';
$severityLabel = isset($this->severityLabels[$severity]) ? $this->severityLabels[$severity] : 'UNKNOWN ';
$output = strftime('%y-%m-%d %H:%M:%S', time()) . $processId . ' ' . $ipAddress . $severityLabel . ' ' . str_pad($packageKey, 20) . ' ' . $message;
if ($this->logMessageOrigin === true && ($className !== null || $methodName !== null)) {
$output .= ' [logged in ' . $className . '::' . $methodName . '()]';
}
if (!empty($additionalData)) {
$output .= PHP_EOL . $this->getFormattedVarDump($additionalData);
}
if ($this->fileHandle !== false) {
fputs($this->fileHandle, $output . PHP_EOL);
}
}