LoggerBuilder
in package
Iteratively configure a logger
Use this to allow creating complex logger setups from a config file or similar source.
Tags
Table of Contents
- $logger : Logger
- $loglevels : LogLevels
- __construct() : mixed
- build() : Logger
- Return a logger
- reset() : self
- Create an all-new logger instance without any handler or filter
- withGlobalFilter() : self
- Add a filter
- withLogHandler() : self
- Add a log handler to a logger
- withLogLevel() : self
- Create a custom log level for the current logger
Properties
$logger
private
Logger
$logger
$loglevels
private
LogLevels
$loglevels
Methods
__construct()
public
__construct([LogLevels $loglevels = null ]) : mixed
Parameters
- $loglevels : LogLevels = null
Return values
mixed —build()
Return a logger
public
build() : Logger
Resets the builder to default state
Return values
Logger —reset()
Create an all-new logger instance without any handler or filter
public
reset([LogLevels $loglevels = null ]) : self
Parameters
- $loglevels : LogLevels = null
Return values
self —withGlobalFilter()
Add a filter
public
withGlobalFilter(LogFilter $filter) : self
Parameters
- $filter : LogFilter
Return values
self —withLogHandler()
Add a log handler to a logger
public
withLogHandler(LogHandler $handler) : self
Parameters
- $handler : LogHandler
Return values
self —withLogLevel()
Create a custom log level for the current logger
public
withLogLevel(int $criticality, string $name) : self
Parameters
- $criticality : int
- $name : string