| 1 | <?php |
||
| 20 | class ErrorLog extends AbstractLogger implements LoggerInterface |
||
| 21 | { |
||
| 22 | const PHP = 0; |
||
| 23 | const MAIL = 1; |
||
| 24 | const FILE = 3; |
||
| 25 | const SAPI = 4; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Holds the destination string (filename path or email address). |
||
| 29 | * @var string |
||
| 30 | */ |
||
| 31 | protected $destination; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Holds the message/delivery type: |
||
| 35 | * 0: message is sent to PHP's system logger. |
||
| 36 | * 1: message is sent by email to the address in the destination. |
||
| 37 | * 3: message is appended to the file destination. |
||
| 38 | * 4: message is sent directly to the SAPI. |
||
| 39 | * @var integer |
||
| 40 | */ |
||
| 41 | protected $type; |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Holds a string of additional (mail) headers. |
||
| 45 | * @var string|null |
||
| 46 | * @see http://php.net/manual/en/function.mail.php |
||
| 47 | */ |
||
| 48 | protected $headers = null; |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Constructor. |
||
| 52 | * @param string|null $file The filename to log messages to. |
||
| 53 | * @param integer $type The messag/delivery type. |
||
| 54 | */ |
||
| 55 | 172 | public function __construct($file = null, $type = self::PHP) |
|
| 60 | |||
| 61 | /** |
||
| 62 | * {@inheritDoc} |
||
| 63 | */ |
||
| 64 | 328 | public function write(LogEntry $log) |
|
| 79 | |||
| 80 | } |