@@ 206-217 (lines=12) @@ | ||
203 | * |
|
204 | * @throws \InvalidArgumentException |
|
205 | */ |
|
206 | protected function createSingleDriver(array $config) |
|
207 | { |
|
208 | if (!isset($config['path'])) { |
|
209 | throw new \InvalidArgumentException('Invalid log file path.'); |
|
210 | } |
|
211 | ||
212 | return new Monolog($this->parseChannel($config), [ |
|
213 | $this->prepareHandler( |
|
214 | new StreamHandler($config['path'], $this->level($config)) |
|
215 | ), |
|
216 | ]); |
|
217 | } |
|
218 | ||
219 | /** |
|
220 | * Create an instance of the daily file log driver. |
|
@@ 228-239 (lines=12) @@ | ||
225 | * |
|
226 | * @throws \InvalidArgumentException |
|
227 | */ |
|
228 | protected function createDailyDriver(array $config) |
|
229 | { |
|
230 | if (!isset($config['path'])) { |
|
231 | throw new \InvalidArgumentException('Invalid log file path.'); |
|
232 | } |
|
233 | ||
234 | return new Monolog($this->parseChannel($config), [ |
|
235 | $this->prepareHandler(new RotatingFileHandler( |
|
236 | $config['path'], Arr::get($config, 'days', 7), $this->level($config) |
|
237 | )), |
|
238 | ]); |
|
239 | } |
|
240 | ||
241 | /** |
|
242 | * Create an instance of the Slack log driver. |