1 <?php
2 require_once 'Zend/Log/Writer/Abstract.php';
3
4 5 6 7 8 9 10 11 12 13 14 15 16 17
18 class SS_LogFileWriter extends Zend_Log_Writer_Abstract {
19
20 21 22 23 24 25
26 protected $path;
27
28 29 30 31 32
33 protected $messageType;
34
35 36 37 38 39
40 protected ;
41
42 public function __construct($path, $messageType = 3, $extraHeaders = '') {
43 $this->path = $path;
44 $this->messageType = $messageType;
45 $this->extraHeaders = $extraHeaders;
46 }
47
48 49 50 51
52 public function _write($event) {
53 if(!$this->_formatter) {
54 $formatter = new SS_LogErrorFileFormatter();
55 $this->setFormatter($formatter);
56 }
57 $message = $this->_formatter->format($event);
58 error_log($message, $this->messageType, $this->path, $this->extraHeaders);
59 }
60
61 }
[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the
Silverstripe Forums to ask development related questions.
-