Documentation

Writer
in package
implements Log, LoggerInterface

Interfaces, Classes and Traits

Log
LoggerInterface
Describes a logger instance.

Table of Contents

$dispatcher  : Dispatcher
The event dispatcher instance.
$levels  : array<string|int, mixed>
The Log levels.
$monolog  : Logger
The Monolog logger instance.
__construct()  : void
Create a new log writer instance.
alert()  : void
Log an alert message to the logs.
critical()  : void
Log a critical message to the logs.
debug()  : void
Log a debug message to the logs.
emergency()  : void
Log an emergency message to the logs.
error()  : void
Log an error message to the logs.
getEventDispatcher()  : Dispatcher
Get the event dispatcher instance.
getMonolog()  : Logger
Get the underlying Monolog instance.
info()  : void
Log an informational message to the logs.
listen()  : void
Register a new callback handler for when a log event is triggered.
log()  : void
Log a message to the logs.
notice()  : void
Log a notice to the logs.
setEventDispatcher()  : void
Set the event dispatcher instance.
useDailyFiles()  : void
Register a daily file log handler.
useErrorLog()  : void
Register an error_log handler.
useFiles()  : void
Register a file log handler.
useSyslog()  : LoggerInterface
Register a Syslog handler.
warning()  : void
Log a warning message to the logs.
write()  : void
Dynamically pass log calls into the writer.
fireLogEvent()  : void
Fires a log event.
formatMessage()  : mixed
Format the parameters for the logger.
getDefaultFormatter()  : LineFormatter
Get a default Monolog formatter instance.
parseLevel()  : int
Parse the string level into a Monolog constant.
writeLog()  : void
Write a message to Monolog.

Properties

$levels

The Log levels.

protected array<string|int, mixed> $levels = ['debug' => MonologLogger::DEBUG, 'info' => MonologLogger::INFO, 'notice' => MonologLogger::NOTICE, 'warning' => MonologLogger::WARNING, 'error' => MonologLogger::ERROR, 'critical' => MonologLogger::CRITICAL, 'alert' => MonologLogger::ALERT, 'emergency' => MonologLogger::EMERGENCY]

$monolog

The Monolog logger instance.

protected Logger $monolog

Methods

__construct()

Create a new log writer instance.

public __construct(Logger $monolog[, Dispatcher|null $dispatcher = null ]) : void
Parameters
$monolog : Logger
$dispatcher : Dispatcher|null = null
Return values
void

alert()

Log an alert message to the logs.

public alert(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []
Return values
void

critical()

Log a critical message to the logs.

public critical(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []
Return values
void

debug()

Log a debug message to the logs.

public debug(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []
Return values
void

emergency()

Log an emergency message to the logs.

public emergency(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []
Return values
void

error()

Log an error message to the logs.

public error(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []
Return values
void

getMonolog()

Get the underlying Monolog instance.

public getMonolog() : Logger
Return values
Logger

info()

Log an informational message to the logs.

public info(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []
Return values
void

listen()

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

public listen(Closure $callback) : void
Parameters
$callback : Closure
Tags
throws
RuntimeException
Return values
void

log()

Log a message to the logs.

public log(string $level, string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$level : string
$message : string
$context : array<string|int, mixed> = []
Return values
void

notice()

Log a notice to the logs.

public notice(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []
Return values
void

setEventDispatcher()

Set the event dispatcher instance.

public setEventDispatcher(Dispatcher $dispatcher) : void
Parameters
$dispatcher : Dispatcher
Return values
void

useDailyFiles()

Register a daily file log handler.

public useDailyFiles(string $path, int $days[, string $level = 'debug' ]) : void
Parameters
$path : string
$days : int
$level : string = 'debug'
Return values
void

useErrorLog()

Register an error_log handler.

public useErrorLog([string $level = 'debug' ][, int $messageType = ErrorLogHandler::OPERATING_SYSTEM ]) : void
Parameters
$level : string = 'debug'
$messageType : int = ErrorLogHandler::OPERATING_SYSTEM
Return values
void

useFiles()

Register a file log handler.

public useFiles(string $path[, string $level = 'debug' ]) : void
Parameters
$path : string
$level : string = 'debug'
Return values
void

useSyslog()

Register a Syslog handler.

public useSyslog([string $name = 'laravel' ][, string $level = 'debug' ][, mixed $facility = LOG_USER ]) : LoggerInterface
Parameters
$name : string = 'laravel'
$level : string = 'debug'
$facility : mixed = LOG_USER
Return values
LoggerInterface

warning()

Log a warning message to the logs.

public warning(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []
Return values
void

write()

Dynamically pass log calls into the writer.

public write(string $level, string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$level : string
$message : string
$context : array<string|int, mixed> = []
Return values
void

fireLogEvent()

Fires a log event.

protected fireLogEvent(string $level, string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$level : string
$message : string
$context : array<string|int, mixed> = []
Return values
void

formatMessage()

Format the parameters for the logger.

protected formatMessage(mixed $message) : mixed
Parameters
$message : mixed
Return values
mixed

parseLevel()

Parse the string level into a Monolog constant.

protected parseLevel(string $level) : int
Parameters
$level : string
Tags
throws
InvalidArgumentException
Return values
int

writeLog()

Write a message to Monolog.

protected writeLog(string $level, string $message, array<string|int, mixed> $context) : void
Parameters
$level : string
$message : string
$context : array<string|int, mixed>
Return values
void

Search results