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

Breadcrumb

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

function LoggerTrait::log

Logs with an arbitrary level.

Parameters

mixed $level:

Throws

\Psr\Log\InvalidArgumentException

8 calls to LoggerTrait::log()
LoggerTrait::alert in vendor/psr/log/src/LoggerTrait.php
Action must be taken immediately.
LoggerTrait::critical in vendor/psr/log/src/LoggerTrait.php
Critical conditions.
LoggerTrait::debug in vendor/psr/log/src/LoggerTrait.php
Detailed debug information.
LoggerTrait::emergency in vendor/psr/log/src/LoggerTrait.php
System is unusable.
LoggerTrait::error in vendor/psr/log/src/LoggerTrait.php
Runtime errors that do not require immediate action but should typically be logged and monitored.

... See full list

3 methods override LoggerTrait::log()
LoggerChannel::log in core/lib/Drupal/Core/Logger/LoggerChannel.php
Logs with an arbitrary level.
NoopLogger::log in vendor/open-telemetry/api/Logs/NoopLogger.php
@codeCoverageIgnore
SimplePsrFileLogger::log in vendor/open-telemetry/sdk/Logs/SimplePsrFileLogger.php
@psalm-suppress MoreSpecificImplementedParamType

File

vendor/psr/log/src/LoggerTrait.php, line 97

Class

LoggerTrait
This is a simple Logger trait that classes unable to extend AbstractLogger (because they extend another class, etc) can include.

Namespace

Psr\Log

Code

public abstract function log($level, string|\Stringable $message, array $context = []) : void;

API Navigation

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