Looking to hire Laravel developers? Try LaraJobs

laravel-process-log maintained by shippinno

Description
Log Laravel process time and memory usage.
Last update
2026/02/12 08:07 (dev-feature/php-version-up)
Links
Downloads
883

Comments
comments powered by Disqus

Laravel Process Log

Installation

composer require shippinno/laravel-process-log

Setup

For Artisan commands logging

Let Shippinno\ProcessLog\ProcessLog::class to be included in bootstrappers of your Console Kernel (usually App\Console\Kernel).

class Kernel extends ConsoleKernel
{
    // ...
 
    protected function bootstrappers()
    {
        return array_merge(
            $this->bootstrappers,
            [ProcessLog::class]
        );
    }
}

Run an Artisan command and it will be logged like below.

[2019-01-22 15:20:13] production.INFO: Starting up process. {"command":"php artisan some:command","pid":12345} []
[2019-01-22 15:20:21] production.INFO: Shutting down process. {"command":"php artisan some:command","time":"8.258[s]","memory":"34[mb]","pid":12345} []

For HTTP requests logging

Same for your HTTP Kernel (usually App\Http\Kernel).

class Kernel extends HttpKernel 
{
    // ...
 
    protected function bootstrappers()
    {
        return array_merge(
            $this->bootstrappers,
            [ProcessLog::class]
        );
    }
}

Make an HTTP request and it will be logged like below.

[2019-01-22 15:41:26] production.INFO: Starting up process. {"method":"GET","uri":"/foo/bar?baz","pid":12345} []
[2019-01-22 15:41:26] production.INFO: Shutting down process. {"method":"GET","uri":"/foo/bar?baz","time":"0.386[s]","memory":"2048[kb]","pid":12345} []

Logging is disabled if the app environment is set to testing.