Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SimplePsrFileLogger.php

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

SimplePsrFileLogger

Namespace

OpenTelemetry\SDK\Logs

Code

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);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal