Skip to content

Commit d8baef6

Browse files
author
Tim Helfensdörfer
committed
Compatible to laravel 5.6
1 parent 71ca613 commit d8baef6

File tree

6 files changed

+504
-36
lines changed

6 files changed

+504
-36
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vendor/

README.md

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# Laravel DatabaseLogger
22

3-
[![Latest Version on Packagist][ico-version]][link-packagist]
4-
[![Software License][ico-license]](LICENSE.md)
5-
6-
Laravel package to log messages into the database instead of, or in addition to, a file.
3+
Laravel package to log messages into a database.
74

85
## Install
96

@@ -15,37 +12,22 @@ $ composer require visualappeal/databaselogger
1512

1613
## Usage
1714

18-
Add the following lines just before the `return $app` statement in `bootstrap/app.php`:
15+
Add the following lines in your `config/logging.php`:
1916

2017
```
21-
$app->configureMonologUsing(function ($monolog) {
22-
$monolog->pushHandler(new VisualAppeal\DatabaseLogger\DatabaseHandler);
23-
24-
// If you want to log to files too, e.g. the application has no database connections
25-
// or the database is down.
26-
$levels = [
27-
'debug' => Monolog\Logger::DEBUG,
28-
'info' => Monolog\Logger::INFO,
29-
'notice' => Monolog\Logger::NOTICE,
30-
'warning' => Monolog\Logger::WARNING,
31-
'error' => Monolog\Logger::ERROR,
32-
'critical' => Monolog\Logger::CRITICAL,
33-
'alert' => Monolog\Logger::ALERT,
34-
'emergency' => Monolog\Logger::EMERGENCY,
35-
];
36-
37-
$monolog->pushHandler(new Monolog\Handler\RotatingFileHandler(
38-
storage_path('/logs/laravel.log'),
39-
7,
40-
$levels[env('APP_LOG_LEVEL')]
41-
));
42-
});
43-
44-
return $app;
18+
'db' => [
19+
'driver' => 'custom',
20+
'via' => VisualAppeal\DatabaseLogger\DatabaseLogger::class,
21+
'level' => env('LOG_LEVEL', 'debug'),
22+
],
4523
```
4624

4725
## Change log
4826

27+
### 1.2.0
28+
29+
* New logging class compatible to Laravel 5.6
30+
4931
### 1.0.0
5032

5133
* First release

composer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@
44
"description": "Laravel package to log messages into the database instead of a file.",
55
"keywords": [
66
"VisualAppeal",
7-
"DatabaseLogger",
8-
"Laravel"
7+
"database",
8+
"logger",
9+
"logging",
10+
"laravel"
911
],
1012
"homepage": "https://github.com/VisualAppeal/DatabaseLogger",
1113
"license": "MIT",
1214
"authors": [
1315
{
1416
"name": "VisualAppeal",
15-
"email": "tim@visualappeal.de",
16-
"homepage": "https://github.com/visualappeal",
17-
"role": "Developer"
17+
"email": "tim@visualappeal.de"
1818
}
1919
],
2020
"require": {
2121
"php" : ">=5.6",
22-
"illuminate/support": "5.*"
22+
"illuminate/support": "5.6.*"
2323
},
2424
"autoload": {
2525
"psr-4": {

0 commit comments

Comments
 (0)