PHP Class cascade\Cascade

Author: Jacob Morrison ([email protected])
Inheritance: implements yii\base\BootstrapInterface
Show file Open project: theorchard/monolog-cascade Class Usage Examples

Protected Properties

Property Type Description
$config Config Config class that holds options for all registered loggers This is optional, you can set up your loggers programmatically

Public Methods

Method Description
createLogger ( string $name, array $handlers = [], array $processors = [] ) : Logger Create a new Logger object and push it to the registry
fileConfig ( string $resource ) Load configuration options from a file or a string
getConfig ( ) : array Return the config options
getLogger ( string $name ) : Logger Get a Logger instance by name. Creates a new one if a Logger with the provided name does not exist
logger ( string $name ) : Logger Alias of getLogger

Method Details

createLogger() public static method

Create a new Logger object and push it to the registry
See also: Monolog\Logger::__construct
public static createLogger ( string $name, array $handlers = [], array $processors = [] ) : Logger
$name string The logging channel
$handlers array Optional stack of handlers, the first one in the array is called first, etc.
$processors array Optional array of processors
return Monolog\Logger Newly created Logger

fileConfig() public static method

Load configuration options from a file or a string
public static fileConfig ( string $resource )
$resource string Path to config file or string or array

getConfig() public static method

Return the config options
public static getConfig ( ) : array
return array Array with configuration options

getLogger() public static method

Get a Logger instance by name. Creates a new one if a Logger with the provided name does not exist
public static getLogger ( string $name ) : Logger
$name string Name of the requested Logger instance
return Monolog\Logger Requested instance of Logger or new instance

logger() public static method

Alias of getLogger
See also: getLogger
public static logger ( string $name ) : Logger
$name string Name of the requested Logger instance
return Monolog\Logger Requested instance of Logger or new instance

Property Details

$config protected static property

Config class that holds options for all registered loggers This is optional, you can set up your loggers programmatically
protected static Config,Cascade $config
return Config