Writer
class Writer implements Log, LoggerInterface (View source)
Properties
protected Logger | $monolog | The Monolog logger instance. |
|
protected Dispatcher | $dispatcher | The event dispatcher instance. |
|
protected array | $levels | The Log levels. |
Methods
Log an emergency message to the logs.
Log an alert message to the logs.
Log a critical message to the logs.
Log an error message to the logs.
Log a warning message to the logs.
Log a notice to the logs.
Log an informational message to the logs.
Log a debug message to the logs.
Log a message to the logs.
Dynamically pass log calls into the writer.
Write a message to Monolog.
Register a file log handler.
Register a daily file log handler.
Register a Syslog handler.
Register an error_log handler.
Fires a log event.
Format the parameters for the logger.
Parse the string level into a Monolog constant.
Get the underlying Monolog instance.
Get a default Monolog formatter instance.
Get the event dispatcher instance.
Details
void
__construct(Logger $monolog, Dispatcher $dispatcher = null)
Create a new log writer instance.
void
emergency(string $message, array $context = [])
Log an emergency message to the logs.
void
alert(string $message, array $context = [])
Log an alert message to the logs.
void
critical(string $message, array $context = [])
Log a critical message to the logs.
void
error(string $message, array $context = [])
Log an error message to the logs.
void
warning(string $message, array $context = [])
Log a warning message to the logs.
void
notice(string $message, array $context = [])
Log a notice to the logs.
void
info(string $message, array $context = [])
Log an informational message to the logs.
void
debug(string $message, array $context = [])
Log a debug message to the logs.
void
log(string $level, string $message, array $context = [])
Log a message to the logs.
void
write(string $level, string $message, array $context = [])
Dynamically pass log calls into the writer.
protected void
writeLog(string $level, string $message, array $context)
Write a message to Monolog.
void
useFiles(string $path, string $level = 'debug')
Register a file log handler.
void
useDailyFiles(string $path, int $days = 0, string $level = 'debug')
Register a daily file log handler.
LoggerInterface
useSyslog(string $name = 'laravel', string $level = 'debug', mixed $facility = LOG_USER)
Register a Syslog handler.
void
useErrorLog(string $level = 'debug', int $messageType = ErrorLogHandler::OPERATING_SYSTEM)
Register an error_log handler.
void
listen(Closure $callback)
Register a new callback handler for when a log event is triggered.
protected void
fireLogEvent(string $level, string $message, array $context = [])
Fires a log event.
protected mixed
formatMessage(mixed $message)
Format the parameters for the logger.
protected int
parseLevel(string $level)
Parse the string level into a Monolog constant.
Logger
getMonolog()
Get the underlying Monolog instance.
protected LineFormatter
getDefaultFormatter()
Get a default Monolog formatter instance.
Dispatcher
getEventDispatcher()
Get the event dispatcher instance.
void
setEventDispatcher(Dispatcher $dispatcher)
Set the event dispatcher instance.