Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

Commit

Permalink
document the new configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
rok committed Jul 25, 2018
1 parent e9ca49f commit 20fe66e
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@
composer require rokde/laravel-slow-query-logger
```

In old Laravel you need to add to `providers` in `config/app.php`:

```
Rokde\LaravelSlowQueryLogger\LaravelSlowQueryLoggerProvider::class,
```
Look into your `laravel.log` file to see your messy queries.

## Installation

Expand All @@ -26,24 +22,30 @@ Run `php artisan vendor:publish --provider="Rokde\LaravelSlowQueryLogger\Laravel

## Configuration

### `time-to-log`
### `enabled`

Only log queries longer than this value in microseconds.
Enable the slow queries logger.

You can set this value through environment variable `LARAVEL_SLOW_QUERY_LOGGER_TIME_TO_LOG`.
You can set this value through environment variable `LARAVEL_SLOW_QUERY_LOGGER_ENABLED`. It is `false` by default.

### `enabled`
### `channel`

Enable the slow queries logger.
Sets the channel to log in.

You can set this value through environment variable `LARAVEL_SLOW_QUERY_LOGGER_ENABLED`.
You can set this value through environment variable `LARAVEL_SLOW_QUERY_LOGGER_CHANNEL`. It is `single` by default.

### `log-level`

Set the log-level for logging the slow queries.

You can set this value through environment variable `LARAVEL_SLOW_QUERY_LOGGER_LOG_LEVEL`.
You can set this value through environment variable `LARAVEL_SLOW_QUERY_LOGGER_LOG_LEVEL`. It is `debug` by default.

### `time-to-log`

Only log queries longer than this value in microseconds.

You can set this value through environment variable `LARAVEL_SLOW_QUERY_LOGGER_TIME_TO_LOG`. It is `0.7` by default.

## Usage

Nothing to do after adding to `/config/app.php`. Watch your logs.
Start your application and look into your logs to identify the slow queries.

0 comments on commit 20fe66e

Please sign in to comment.