-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEloquentHandler.php
executable file
·39 lines (30 loc) · 996 Bytes
/
EloquentHandler.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Handler;
use Monolog\Formatter\JsonFormatter;
use Monolog\Logger;
use Monolog\Handler\AbstractProcessingHandler;
/* DA COPIARE NELLA CARTELLA vendor/monolog/src/Monolog/Handler */
class EloquentHandler extends AbstractProcessingHandler {
public function __construct($level = Logger::DEBUG, $bubble = true)
{
parent::__construct($level, $bubble);
}
protected function write(array $record) {
//var_dump($record);
\App\Models\Log::create([
'env' => $record['channel'],
'message' => substr($record['message'],0,475),
'level' => $record['level_name'],
'context' => $record['context'],
'extra' => $record['extra']
]);
}
}