PHP Class Phalcon\Logger\Adapter\File\Multiple

Adapter to save logs into multiple log files based on their level. TODO Implement transactions.
Inheritance: extends Phalcon\Logger\Adapter\File, implements Phalcon\Logger\AdapterInterface
Show file Open project: phalcon/incubator

Protected Properties

Property Type Description
$options array Adapter options.
$path string Path to the directory where log files will be saved. No trailing slash.

Public Methods

Method Description
__construct ( string $path, array $options = [] ) Class constructor.
begin ( )
commit ( )
logInternal ( string $message, integer $type, integer $time, array $context = [] ) Writes the log to the file itself
rollback ( )

Protected Methods

Method Description
getTypeString ( integer $type ) : string getTypeString

Method Details

__construct() public method

Class constructor.
public __construct ( string $path, array $options = [] )
$path string Directory path for saving the log files.
$options array The following options are available: - extension (string) Extension for all log files. - prefix (string) Name prefix for all log files

begin() public method

public begin ( )

commit() public method

public commit ( )

getTypeString() protected method

Translates Phalcon log types into type strings. TODO: It would be nice to make a config option to say which error levels go into what files.
protected getTypeString ( integer $type ) : string
$type integer
return string

logInternal() public method

Writes the log to the file itself
public logInternal ( string $message, integer $type, integer $time, array $context = [] )
$message string
$type integer
$time integer
$context array

rollback() public method

public rollback ( )

Property Details

$options protected property

Adapter options.
protected array $options
return array

$path protected property

Path to the directory where log files will be saved. No trailing slash.
protected string $path
return string