Google\Cloud\Logging\LoggingClient::psrLogger PHP 메소드

psrLogger() 공개 메소드

Example: $psrLogger = $logging->psrLogger('my-log');
public psrLogger ( string $name, array $options = [] ) : PsrLogger
$name string The name of the log to write entries to.
$options array [optional] { Configuration options. @type string $messageKey The key in the `jsonPayload` used to contain the logged message. **Defaults to** `message`. @type array $resource The [monitored resource](https://cloud.google.com/logging/docs/api/reference/rest/Shared.Types/MonitoredResource) to associate log entries with. **Defaults to** type global. @type array $labels A set of user-defined (key, value) data that provides additional information about the log entry. }
리턴 PsrLogger
    public function psrLogger($name, array $options = [])
    {
        $messageKey = null;
        if (isset($options['messageKey'])) {
            $messageKey = $options['messageKey'];
            unset($options['messageKey']);
        }
        return $messageKey ? new PsrLogger($this->logger($name, $options), $messageKey) : new PsrLogger($this->logger($name, $options));
    }