LoggerFactory
in package
Class LoggerFactory
Table of Contents
- $application : Application|null
- create() : LoggerInterface
- Creates a new logger instance.
- registerApplication() : void
- Registers the application instance.
- getLoggerBuilder() : LoggerBuilder
- Returns the logger builder or create a new one.
Properties
$application
private
static Application|null
$application
Methods
create()
Creates a new logger instance.
public
static create([string $namespace = 'general' ][, bool $addRequestData = false ]) : LoggerInterface
Parameters
- $namespace : string = 'general'
- $addRequestData : bool = false
Return values
LoggerInterface —registerApplication()
Registers the application instance.
public
static registerApplication(Application $application) : void
Its required to get access to the logger instance. This step should be done in a bootable service provider.
Parameters
- $application : Application
Return values
void —getLoggerBuilder()
Returns the logger builder or create a new one.
private
static getLoggerBuilder() : LoggerBuilder
This method could raise a fatal error (if the static::$application member is not set), but we accept to not throw any exception if this is the cause to improve IDE experience. (Otherwise it would be required to place "throws" annotations everytime the logger is used).
If this error happen, its likely that ::registerApplication was not called previously.