function SimplePsrFileLogger::formatLog
Return value
string
1 call to SimplePsrFileLogger::formatLog()
- SimplePsrFileLogger::log in vendor/
open-telemetry/ sdk/ Logs/ SimplePsrFileLogger.php - @psalm-suppress MoreSpecificImplementedParamType
File
-
vendor/
open-telemetry/ sdk/ Logs/ SimplePsrFileLogger.php, line 47
Class
Namespace
OpenTelemetry\SDK\LogsCode
private function formatLog(string $level, string $message, array $context = []) : string {
try {
$encodedContext = json_encode($context, JSON_THROW_ON_ERROR);
} catch (Throwable $t) {
$encodedContext = sprintf('(Could not encode context: %s)', $t->getMessage());
}
return sprintf('[%s] %s %s: %s %s%s', date(DATE_RFC3339_EXTENDED), $this->loggerName, $level, $message, $encodedContext, PHP_EOL);
}