dejwcake/advanced-logger

Advanced logger
14,436
Install
composer require dejwcake/advanced-logger
Latest Version:2.0.0
PHP:^8.5
License:MIT
Last Updated:Aug 6, 2026
Links: GitHub  ·  Packagist
Maintainer: dejwCake

Advanced Logger

Advanced Logger is a Laravel package that automatically logs every HTTP request made to your Laravel application. Each request is assigned a unique hash, which can also be included in your standard logs to easily match log entries to a specific request.

This package is inspired by https://github.com/andersao/laravel-request-logger by Anderson Andrade.

Installation

Composer

Run composer require dejwcake/advanced-logger in your terminal.

Laravel

This package is for Laravel 13.

To publish config file, run

php artisan vendor:publish --provider="Brackets\AdvancedLogger\AdvancedLoggerServiceProvider"

Configuration

All options are described in config/advanced-logger.php.

Using request hash in standard log file

If you would like to include the request identifier in your standard log so you can match log events to a specific request, add the following to config/logging.php:

'tap' => [Brackets\AdvancedLogger\LogCustomizers\HashLogCustomizer::class],

to daily channel. The resulted code should looks like

    'channels' => [
        ...

        'daily' => [
            'driver' => 'daily',
            'path' => storage_path('logs/laravel.log'),
            'level' => 'debug',
            'days' => 14,
            'tap' => [Brackets\AdvancedLogger\LogCustomizers\HashLogCustomizer::class],
        ],

        ...
    ],

This log modifier can also be applied to other logging channels. However, it relies on an extended LineFormatter, so make sure the target channel is compatible with that formatter.

How to develop this project

Composer

Update dependencies:

docker compose run -it --rm test composer update

Composer normalization:

docker compose run -it --rm php-qa composer normalize

Run code analysis tools (php-qa)

PHP compatibility:

docker compose run -it --rm php-qa phpcs --standard=.phpcs.compatibility.xml --cache=.phpcs.cache

Code style:

docker compose run -it --rm php-qa phpcs -s --colors --extensions=php

Fix style issues:

docker compose run -it --rm php-qa phpcbf -s --colors --extensions=php

Static analysis (phpstan):

docker compose run -it --rm php-qa phpstan analyse --configuration=phpstan.neon

Mess detector (phpmd):

docker compose run -it --rm php-qa phpmd ./config,./src,./tests ansi phpmd.xml --suffixes php --baseline-file phpmd.baseline.xml

Run tests

Run tests:

docker compose run -it --rm test ./vendor/bin/phpunit

Run tests with coverage:

docker compose run -it --rm test ./vendor/bin/phpunit --coverage-text

Run the whole PHP suite

Run every PHP check and the test suite in sequence (stops at the first failure):

docker compose run -it --rm test composer update \
  && docker compose run -it --rm php-qa composer normalize \
  && docker compose run -it --rm php-qa phpcs --standard=.phpcs.compatibility.xml --cache=.phpcs.cache \
  && docker compose run -it --rm php-qa phpcs -s --colors --extensions=php \
  && docker compose run -it --rm php-qa phpstan analyse --configuration=phpstan.neon \
  && docker compose run -it --rm php-qa phpmd ./config,./src,./tests ansi phpmd.xml --suffixes php --baseline-file phpmd.baseline.xml \
  && docker compose run -it --rm test ./vendor/bin/phpunit

Related Packages

brackets/advanced-logger

Advanced logger

259,407 1
jmarcher/laravel-request-logger

HTTP request logger middleware for Laravel

5,199 6
mnabialek/laravel-sql-logger

Log SQL queries in Laravel/Lumen framework

841,148 158
libern/laravel-sql-logging

Laravel 5 package for logging SQL queries.

4,598 0
ytake/laravel-aspect

Aspect Oriented Programming library for laravel framework, and lumen

143,346 138