|
Plop
A simple logging library for PHP
|
An handler that writes log messages to a file. More...
Inheritance diagram for Plop\Handler\File:Public Member Functions | |
| __construct ($filename, $mode= 'at', $delay=false) | |
| __destruct () | |
| Free the resources used by this handler. | |
Public Member Functions inherited from Plop\Handler\Stream | |
| __construct ($stream=null) | |
Public Member Functions inherited from Plop\HandlerAbstract | |
| __construct (\Plop\FormatterInterface $formatter=null,\Plop\FiltersCollectionAbstract $filters=null) | |
| getFilters () | |
| getFormatter () | |
| handle (\Plop\RecordInterface $record) | |
| handleError (\Plop\RecordInterface $record,\Exception $exception) | |
| setFilters (\Plop\FiltersCollectionAbstract $filters) | |
| setFormatter (\Plop\FormatterInterface $formatter) | |
Protected Member Functions | |
| close () | |
| emit (\Plop\RecordInterface $record) | |
| open () | |
Protected Member Functions inherited from Plop\Handler\Stream | |
| emit (\Plop\RecordInterface $record) | |
| flush () | |
Protected Member Functions inherited from Plop\HandlerAbstract | |
| emit (\Plop\RecordInterface $record) | |
| format (\Plop\RecordInterface $record) | |
| getStderr () | |
Protected Attributes | |
| $baseFilename | |
| Path to the log file this handler writes to. | |
| $mode | |
| Opening mode for the log file. | |
Protected Attributes inherited from Plop\Handler\Stream | |
| $stream | |
| The stream where log messages will be write to. | |
Protected Attributes inherited from Plop\HandlerAbstract | |
| $filters | |
| An object handling a collection of filters. | |
| $formatter | |
| Formatter object to use for this handler. | |
Additional Inherited Members | |
Static Protected Attributes inherited from Plop\Handler\Stream | |
| static | $stderr = null |
| A stream referencing STDERR. | |
| Plop\Handler\File::__construct | ( | $filename, | |
$mode = 'at', |
|||
$delay = false |
|||
| ) |
Construct a new instance of this handler.
| string | $filename | Name of the log file to write to. |
| string | $mode | (optional) Mode to use when opening the file. Defauts to "at" (append). |
| bool | $delay | (optional) Whether to delay the actual opening of the file until the first write. Defaults to false (no delay). |
Definition at line 51 of file File.php.
References Plop\Handler\File\$mode, Plop\Handler\Stream\$stream, and Plop\Handler\File\open().
|
protected |
Close the log file.
Definition at line 99 of file File.php.
References Plop\Handler\Stream\flush().
Referenced by Plop\Handler\File\__destruct().
|
protected |
Definition at line 85 of file File.php.
References Plop\Handler\File\open().
|
protected |
Open the log file.
| resource | A stream representing the newly opened log file. |
Definition at line 79 of file File.php.
Referenced by Plop\Handler\File\__construct(), Plop\Handler\RotatingFile\doRollover(), Plop\Handler\TimedRotatingFile\doRollover(), Plop\Handler\WatchedFile\emit(), Plop\Handler\File\emit(), and Plop\Handler\RotatingFile\shouldRollover().