Download the PHP package akshitarora/dblog without Composer

On this page you can find all versions of the php package akshitarora/dblog. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package dblog

Laravel DB Log (Performance & Query Logger)

GitHub

A lightweight Laravel package to log slow database queries and long-running HTTP requests in your application. It helps you pinpoint performance bottlenecks by automatically tracking slow queries, identifying their exact source files, and catching N+1 issues by measuring overall page load times.

Why use this package?

Requirements

Installation

Install the package via Composer:

(Note: If you are using Laravel 8 or 9, please use older releases of this package.)

Laravel will automatically discover the service provider. However, if you've disabled auto-discovery, add the ServiceProvider in config/app.php or bootstrap/providers.php depending on your Laravel version:

Configuration

Publish the dblog.php configuration file to customize thresholds and features:

Configuration Options Breakdown

Option Type Default Description
enabled boolean true (local) Master switch to enable or disable the package logging entirely.
query_slower_than float 0 Queries taking longer than this time (in seconds) will be logged.
sanitize_queries boolean true When true, query bindings (e.g., passwords, emails) are replaced with ? to prevent sensitive data leaks in logs.
track_sources boolean true When true, attempts to trace the exact file and line number that executed the slow query.
track_slow_pages boolean true Enables or disables the TrackSlowPages middleware from logging slow requests.
page_slower_than float 1.5 Requests taking longer than this time (in seconds) will be logged (requires middleware).
ignore_routes array [] Routes to completely ignore (supports * wildcards, e.g. telescope/*).
trigger string null Force logs to record if a specific variable is found in the environment, HTTP Headers, GET, POST, or Cookies (great for debugging production secretly).
folder_path string null Custom directory to store logs. If left null, logs go to storage/logs/dblog/.
time_brackets array [2, 4, 5] Time thresholds used to group slow queries into different log files (e.g., separating 2-4s queries from 5s+ queries).

Features & Usage

1. Slow Query Logging

By default, the package will monitor your application's queries. You can configure query_slower_than in your dblog.php (or .env via DBLOG_QUERY_SLOWER_THAN) to specify the threshold in seconds.

The logs are written to storage/logs/dblog/ by default (or to folder_path if configured). Each slow query line includes its timestamp, database, SQL, duration, and request. Slow query files are named slow_query_YYYYMMDD_<time-bracket>.log (the bracket is omitted if time_brackets is empty):

2. Slow Page Tracking (Middleware)

While queries might be fast, rendering the page or executing PHP could be slow. To track overall slow requests, add the TrackSlowPages middleware to your global middleware stack in bootstrap/app.php (Laravel 11+) or app/Http/Kernel.php (Laravel 10):

Configure page_slower_than in your config to set the threshold. It outputs to slow_pages_YYYYMMDD.log in the same folder:

3. Ignoring Specific Routes

Don't want to log queries from Telescope, Horizon, or your Admin panel? You can easily ignore them in the config/dblog.php file using wildcards:

Testing

Security

Please ensure your storage/logs directory is not publicly accessible if you deploy this package to production.

Credits

Special thanks to the original inspiration for query logging: overtrue/laravel-query-logger.

License

The MIT License (MIT). Please see License File for more information.


All versions of dblog with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/database Version ^10.0|^11.0|^12.0|^13.0
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package akshitarora/dblog contains the following files

Loading the files please wait ...