PHPackages                             emanuele/querylog-sql - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. emanuele/querylog-sql

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

emanuele/querylog-sql
=====================

Log non-SELECT SQL queries to rotating files with daily gzip.

00PHP

Since Feb 3Pushed 3mo agoCompare

[ Source](https://github.com/emanuelelocatelli/querylog)[ Packagist](https://packagist.org/packages/emanuele/querylog-sql)[ RSS](/packages/emanuele-querylog-sql/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Querylog SQL
============

[](#querylog-sql)

Package Laravel per loggare tutte le query non-SELECT in file di testo, con rotazione a 100MB e compressione giornaliera.

Installazione (locale)
----------------------

[](#installazione-locale)

Nel progetto host:

1. Aggiungi il repository `path` e il require in `composer.json`:

```
{
  "repositories": [
    { "type": "path", "url": "packages/querylog-sql", "options": { "symlink": true } }
  ],
  "require": {
    "emanuele/querylog-sql": "^1.0"
  }
}
```

2. Esegui `composer update emanuele/querylog-sql`.

Installazione (repository Git)
------------------------------

[](#installazione-repository-git)

1. Pubblica il pacchetto in un repo Git (privato o pubblico).
2. Aggiungi il repository VCS e installa:

```
{
  "repositories": [
    { "type": "vcs", "url": "https://example.com/emanuele/querylog-sql.git" }
  ]
}
```

```
composer require emanuele/querylog-sql
```

Configurazione
--------------

[](#configurazione)

Config pubblicabile:

```
php artisan vendor:publish --tag=querylog-config
```

Variabili supportate:

- `QUERYLOG_ENABLED` (default: true)
- `QUERYLOG_PATH` (default: `storage/logs/querylog`)
- `QUERYLOG_MAX_FILE_SIZE_MB` (default: 100)
- `QUERYLOG_INCLUDE_BINDINGS` (default: true)

Blocco `.env` di esempio:

```
QUERYLOG_ENABLED=true
QUERYLOG_PATH=storage/logs/querylog
QUERYLOG_MAX_FILE_SIZE_MB=100
QUERYLOG_INCLUDE_BINDINGS=true

```

Se le variabili non sono presenti in `.env`, il pacchetto usa automaticamente i valori di default indicati sopra.

Output
------

[](#output)

Ogni riga è nel formato:

```
/* YYYY-MM-DD HH:MM:SS */ SQL

```

I file sono in `storage/logs/querylog/` e ruotano a 100MB:

```
querylog-YYYY-MM-DD-1.log
querylog-YYYY-MM-DD-2.log
...

```

Compressione giornaliera
------------------------

[](#compressione-giornaliera)

Un job comprime i log del giorno precedente in `.gz` alle 23:59, e rimuove i file originali dopo la compressione.

Per schedulare il job nel progetto host, aggiungi a `routes/console.php`:

```
use Emanuele\QuerylogSql\Jobs\CompressDailyQueryLogs;
use Illuminate\Support\Facades\Schedule;

Schedule::job(new CompressDailyQueryLogs())
    ->dailyAt('23:59')
    ->withoutOverlapping(60);
```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance54

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/d740f5d181311c9b372461c939cb75d3fbbbd8b758d3fa9bae0f1d0c94be1061?d=identicon)[emanuelelocatelli](/maintainers/emanuelelocatelli)

---

Top Contributors

[![emanuelelocatelli](https://avatars.githubusercontent.com/u/10850878?v=4)](https://github.com/emanuelelocatelli "emanuelelocatelli (1 commits)")

### Embed Badge

![Health badge](/badges/emanuele-querylog-sql/health.svg)

```
[![Health](https://phpackages.com/badges/emanuele-querylog-sql/health.svg)](https://phpackages.com/packages/emanuele-querylog-sql)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[ekino/newrelic-bundle

Integrate New Relic into Symfony2

28111.2M8](/packages/ekino-newrelic-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
