Giter VIP home page Giter VIP logo

laravel-slow-query-logger's Introduction

Slow Query Logger for Laravel

Latest Stable Version Latest Unstable Version License Total Downloads

Quickstart

composer require rokde/laravel-slow-query-logger

Look into your laravel.log file to see your messy queries.

Installation

Add to your composer.json following lines

"require": {
	"rokde/laravel-slow-query-logger": "^1.*"
}

Run php artisan vendor:publish --provider="Rokde\LaravelSlowQueryLogger\LaravelSlowQueryLoggerProvider"

Configuration

enabled

Enable the slow queries logger.

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

channel

Sets the channel to log in.

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. 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

Start your application and look into your logs to identify the slow queries.

laravel-slow-query-logger's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

laravel-slow-query-logger's Issues

Log channel and Query time

Hi!
In commit 3267fee
You use static channel name 'single' (not from config)

And $queryExecuted->time declared as milliseconds

Laravel 5.8

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.