class Illuminate / Log / Logger
You are viewing an older version of the documentation. For the latest, please visit master documentation.

Logger

Implements

  • Psr\...\LoggerInterface

Properties

protected

$logger
  • Psr\...\LoggerInterface
  • The underlying logger implementation.

    Default: null
    protected

    $dispatcher
  • Dispatcher
  • null
  • The event dispatcher instance.

    Default: null
    protected

    $context array

    Any context to be added to logs.

    Default: []

    Methods

    public

    __construct ( Psr\...\LoggerInterface $logger , Dispatcher $dispatcher ) : void

    Create a new log writer instance.

    Parameters

    • $logger Psr\...\LoggerInterface
    • $dispatcher Dispatcher |null
    public

    emergency ( $message , array $context ) : void

    Log an emergency message to the logs.

    Parameters

    • $message string
    • $context array
    public

    alert ( $message , array $context ) : void

    Log an alert message to the logs.

    Parameters

    • $message string
    • $context array
    public

    critical ( $message , array $context ) : void

    Log a critical message to the logs.

    Parameters

    • $message string
    • $context array
    public

    error ( $message , array $context ) : void

    Log an error message to the logs.

    Parameters

    • $message string
    • $context array
    public

    warning ( $message , array $context ) : void

    Log a warning message to the logs.

    Parameters

    • $message string
    • $context array
    public

    notice ( $message , array $context ) : void

    Log a notice to the logs.

    Parameters

    • $message string
    • $context array
    public

    info ( $message , array $context ) : void

    Log an informational message to the logs.

    Parameters

    • $message string
    • $context array
    public

    debug ( $message , array $context ) : void

    Log a debug message to the logs.

    Parameters

    • $message string
    • $context array
    public

    log ( $level , $message , array $context ) : void

    Log a message to the logs.

    Parameters

    • $level string
    • $message string
    • $context array
    public

    write ( $level , $message , array $context ) : void

    Dynamically pass log calls into the writer.

    Parameters

    • $level string
    • $message string
    • $context array
    protected

    writeLog ( $level , $message , $context ) : void

    Write a message to the log.

    Parameters

    • $level string
    • $message string
    • $context array
    public

    withContext ( array $context ) : $this

    Add context to all future logs.

    Parameters

    • $context array
    public

    withoutContext ( ) : $this

    Flush the existing context array.

    public

    listen ( Closure $callback ) : void

    Register a new callback handler for when a log event is triggered.

    Parameters

    protected

    fireLogEvent ( $level , $message , array $context ) : void

    Fires a log event.

    Parameters

    • $level string
    • $message string
    • $context array
    protected

    formatMessage ( $message ) : mixed

    Format the parameters for the logger.

    Parameters

    • $message mixed
    public

    getLogger ( ) : Psr\...\LoggerInterface

    Get the underlying logger implementation.

    public

    getEventDispatcher ( ) : Dispatcher

    Get the event dispatcher instance.

    public

    setEventDispatcher ( Dispatcher $dispatcher ) : void

    Set the event dispatcher instance.

    Parameters

    public

    __call ( $method , $parameters ) : mixed

    Dynamically proxy method calls to the underlying logger.

    Parameters

    • $method string
    • $parameters array