Skip to content

Commit

Permalink
Compatible to laravel 5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
thelfensdrfer committed Feb 15, 2018
1 parent 71ca613 commit d8baef6
Show file tree
Hide file tree
Showing 6 changed files with 504 additions and 36 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vendor/
40 changes: 11 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Laravel DatabaseLogger

[![Latest Version on Packagist][ico-version]][link-packagist]
[![Software License][ico-license]](LICENSE.md)

Laravel package to log messages into the database instead of, or in addition to, a file.
Laravel package to log messages into a database.

## Install

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

## Usage

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

```
$app->configureMonologUsing(function ($monolog) {
$monolog->pushHandler(new VisualAppeal\DatabaseLogger\DatabaseHandler);
// If you want to log to files too, e.g. the application has no database connections
// or the database is down.
$levels = [
'debug' => Monolog\Logger::DEBUG,
'info' => Monolog\Logger::INFO,
'notice' => Monolog\Logger::NOTICE,
'warning' => Monolog\Logger::WARNING,
'error' => Monolog\Logger::ERROR,
'critical' => Monolog\Logger::CRITICAL,
'alert' => Monolog\Logger::ALERT,
'emergency' => Monolog\Logger::EMERGENCY,
];
$monolog->pushHandler(new Monolog\Handler\RotatingFileHandler(
storage_path('/logs/laravel.log'),
7,
$levels[env('APP_LOG_LEVEL')]
));
});
return $app;
'db' => [
'driver' => 'custom',
'via' => VisualAppeal\DatabaseLogger\DatabaseLogger::class,
'level' => env('LOG_LEVEL', 'debug'),
],
```

## Change log

### 1.2.0

* New logging class compatible to Laravel 5.6

### 1.0.0

* First release
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@
"description": "Laravel package to log messages into the database instead of a file.",
"keywords": [
"VisualAppeal",
"DatabaseLogger",
"Laravel"
"database",
"logger",
"logging",
"laravel"
],
"homepage": "https://github.com/VisualAppeal/DatabaseLogger",
"license": "MIT",
"authors": [
{
"name": "VisualAppeal",
"email": "[email protected]",
"homepage": "https://github.com/visualappeal",
"role": "Developer"
"email": "[email protected]"
}
],
"require": {
"php" : ">=5.6",
"illuminate/support": "5.*"
"illuminate/support": "5.6.*"
},
"autoload": {
"psr-4": {
Expand Down
Loading

0 comments on commit d8baef6

Please sign in to comment.