1 | <?php |
||
33 | class LogfileHandler extends StreamHandler |
||
34 | { |
||
35 | /** |
||
36 | * rotation type |
||
37 | * @var int |
||
38 | */ |
||
39 | const ROTATE_NONE = 0; // do not rotate |
||
40 | const ROTATE_DATE = -1; // rotate by date |
||
41 | |||
42 | /** |
||
43 | * Constructor |
||
44 | * |
||
45 | * @param string $path full path |
||
46 | * @param int $rotate rotate type or filesize in M |
||
47 | * @param FormatterInterface $formatter |
||
48 | * @param bool $stopPropagation |
||
49 | * @throws LogicException if path not writable |
||
50 | * @access public |
||
51 | */ |
||
52 | public function __construct( |
||
74 | |||
75 | /** |
||
76 | * Check file path |
||
77 | * |
||
78 | * @param string $path |
||
79 | * @throws LogicException if directory failure etc. |
||
80 | * @access protected |
||
81 | */ |
||
82 | protected function checkPath(/*# string */$path) |
||
98 | |||
99 | /** |
||
100 | * Rotate file on start |
||
101 | * |
||
102 | * @param string $path |
||
103 | * @param int $type |
||
104 | * @return bool rotation status |
||
105 | * @access protected |
||
106 | */ |
||
107 | protected function doRotation( |
||
125 | |||
126 | /** |
||
127 | * Rotate $path to $path_20160616 |
||
128 | * |
||
129 | * @param string $path |
||
130 | * @param string $format date format |
||
131 | * @return bool rotation status |
||
132 | * @access protected |
||
133 | */ |
||
134 | protected function rotateByDate( |
||
141 | |||
142 | /** |
||
143 | * Rotate $path if filesize > the specified in MB |
||
144 | * |
||
145 | * Rotate to $path.201606141310 (hour & minute) |
||
146 | * |
||
147 | * @param string $path |
||
148 | * @param int $size size in MB |
||
149 | * @return bool rotation status |
||
150 | * @access protected |
||
151 | */ |
||
152 | protected function rotateBySize( |
||
161 | } |
||
162 |