Writer
class Writer (View source)
Properties
protected Logger | $monolog | The Monolog logger instance. |
|
protected array | $levels | All of the error levels. |
|
protected Dispatcher | $dispatcher | The event dispatcher instance. |
Methods
Call Monolog with the given method and parameters.
Register a file log handler.
Register a daily file log handler.
Register an error_log handler.
Get a default Monolog formatter instance.
Parse the string level into a Monolog constant.
Get the underlying Monolog instance.
Get the event dispatcher instance.
Fires a log event.
Dynamically pass log calls into the writer.
Dynamically handle error additions.
Format the parameters for the logger.
Details
void
__construct(Logger $monolog, Dispatcher $dispatcher = null)
Create a new log writer instance.
protected mixed
callMonolog(string $method, mixed $parameters)
Call Monolog with the given method and parameters.
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.
void
useErrorLog(string $level = 'debug', int $messageType = ErrorLogHandler::OPERATING_SYSTEM)
Register an error_log handler.
protected LineFormatter
getDefaultFormatter()
Get a default Monolog formatter instance.
protected int
parseLevel(string $level)
Parse the string level into a Monolog constant.
void
listen(Closure $callback)
Register a new callback handler for when a log event is triggered.
Logger
getMonolog()
Get the underlying Monolog instance.
Dispatcher
getEventDispatcher()
Get the event dispatcher instance.
void
setEventDispatcher(Dispatcher $dispatcher)
Set the event dispatcher instance.
protected void
fireLogEvent(string $level, string $message, array $context = array())
Fires a log event.
mixed
write()
Dynamically pass log calls into the writer.
mixed
__call(string $method, mixed $parameters)
Dynamically handle error additions.
protected void
formatParameters(mixed $parameters)
Format the parameters for the logger.