PHPackages                             devthis/console-logg - 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. devthis/console-logg

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

devthis/console-logg
====================

Effortless artisan console output with your usual Laravel logger

v1.3.0(3y ago)1112.7k—0%1MITPHPPHP &gt;=7.1|8.\*

Since Nov 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/dev-this/laravel-console-logg)[ Packagist](https://packagist.org/packages/devthis/console-logg)[ RSS](/packages/devthis-console-logg/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (5)Versions (10)Used By (0)

Laravel ConsoleLogg
===================

[](#laravel-consolelogg)

[![PHPUnit suite](https://github.com/dev-this/laravel-console-logg/workflows/PHPUnit%20suite/badge.svg)](https://github.com/dev-this/laravel-console-logg/workflows/PHPUnit%20suite/badge.svg)[![codecov](https://camo.githubusercontent.com/1a830c494a16138eedd6998dbf916997e32aff1c69c414369e3ae6d0bc815eba/68747470733a2f2f636f6465636f762e696f2f67682f6465762d746869732f6c61726176656c2d636f6e736f6c652d6c6f67672f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/dev-this/laravel-console-logg)[![Latest Stable Version](https://camo.githubusercontent.com/0229307a81cec839d1cea9985434b558436ea9f0f5f783b8057ad92c7b371418/68747470733a2f2f706f7365722e707567782e6f72672f646576746869732f636f6e736f6c652d6c6f67672f76)](https://packagist.org/packages/devthis/console-logg)[![Total Downloads](https://camo.githubusercontent.com/77c2c4974c260e3f77b3fd346435c387dc25c16e6d17c482b904f3812f3d1f38/68747470733a2f2f706f7365722e707567782e6f72672f646576746869732f636f6e736f6c652d6c6f67672f646f776e6c6f616473)](https://packagist.org/packages/devthis/console-logg)[![License](https://camo.githubusercontent.com/58c4eb63e2d3b748332fd231c9744c636d4e83168407e8fe264a7122a7775d97/68747470733a2f2f706f7365722e707567782e6f72672f646576746869732f636f6e736f6c652d6c6f67672f6c6963656e7365)](https://packagist.org/packages/devthis/console-logg)[![FOSSA Status](https://camo.githubusercontent.com/debbf239e216566997eec695aa8603e4b60555bcee837043d460470da6ef9730/68747470733a2f2f6170702e666f7373612e636f6d2f6170692f70726f6a656374732f637573746f6d25324232313432342532466769742534306769746875622e636f6d2533416465762d746869732532466c61726176656c2d636f6e736f6c652d6c6f67672e6769742e7376673f747970653d736869656c64)](https://app.fossa.com/projects/custom%2B21424%2Fgit%40github.com%3Adev-this%2Flaravel-console-logg.git?ref=badge_shield)

#### Effortless PSR-3 Logger output to your console applications

[](#effortless-psr-3-logger-output-to-your-console-applications)

Powered by [Symfony's Console Logger](https://symfony.com/doc/current/components/console/logger.html)

Table of contents
-----------------

[](#table-of-contents)

- [Install](#Install)
    - [Compatibility](#compatibility)
- [Features](#features)
    - [Artisan serve supported](#artisan-serve-supported)
    - [Literally Effortless](#literally-effortless)
    - [Command-in-command](#command-in-command)
- [Light footprint](#light-footprint)
- [Usage](#usage)
    - [Verbosity](#verbosity)
    - [Code example](#code-example)
- [License](#license)

What does it do?
================

[](#what-does-it-do)

**Logger channel for sharing messages between application and console commands**

Typically, this requires a hacky solution, such as coupling your shared services with a console logger, or configuring multiple driver channels.

With ConsoleLogg you can have logs for your artisan commands, and behave as usual with http/controllers.

**No code changes are required with logger usage**

Supported:

- *Dependency Injection/autowiring* `LoggerInterface $logger` &amp; `$logger->debug("yeet")`
- `logger()->critical("Send help")`
- `Log::alert("She find pictures in my email")`
- `Log::info("Found  to be processed")`

```
php artisan my:command -vvv
[debug] yeet
[critical] Send help
[alert] She find pictures in my email
[info] Found  to be processed

```

---

Install
-------

[](#install)

1. Install the package via Composer:

    ```
    composer require devthis/console-logg
    ```
2. Enable logging channel `console-logg`

`config/logging.php`

```
    'channels' => [
        'stack' => [
            'driver' => 'stack',
-            'channels' => ['single'],
+            'channels' => ['console-logg', 'single'],
            'ignore_exceptions' => false,
        ],
```

[Laravel - Logging Docs](https://laravel.com/docs/8.x/logging#building-log-stacks)

### Compatibility

[](#compatibility)

CompatibleLaravel✔️10.\*✔️9.\*✔️8.\*✔️7.\*✔️6.\*---

Features
========

[](#features)

Artisan serve supported
-----------------------

[](#artisan-serve-supported)

Logger output will be shown in your local development server console.

Literally Effortless
--------------------

[](#literally-effortless)

Your application **will not be coupled** with ConsoleLogg.

There are no traits, classes, interfaces that you need to use. ConsoleLogg does not require any custom code, it just works.

The ConsoleLog Service Provider should be automatically added to your app, but if it hasn't, you can add it yourself to `config/app.php`

```
// generally only required when you have composer installed with --no-scripts

'providers' => [
    //...
    \DevThis\ConsoleLogg\Providers\ConsoleLoggServiceProvider::class,
];
```

Command-in-command
------------------

[](#command-in-command)

ConsoleLogg has (not yet) been tested for compatibility using artisan commands in a command with [nested command calls](https://laravel.com/docs/8.x/artisan#calling-commands-from-other-commands)

```
namespace App\Console\Commands;

use Illuminate\Console\Command;

class MyConsoleApp extends Command
{
    protected $description = '';
    protected $signature = 'my:app';

    public function handle(): int
    {
        //other:command may invoke services that use the Laravel Logger
        //these logs will still output to this current console
        $this->call('other:command');
        //...

        return 0;
    }
}
```

---

Light footprint
===============

[](#light-footprint)

- **Zero external dependencies** outside of Laravel contracts
- No memory leakage (*needs validation/tests*)
    - One time use console logger is attached &amp; detached alongside command execution
    - All references destroyed after command termination *(letting PHP Garbage Collection do its thing)*
- Service Provider lazily works only when running in console mode

---

Usage
=====

[](#usage)

Verbosity
---------

[](#verbosity)

Verbosity is optionally controlled by either using `-v` arguments when running artisan.

This is not behaviour set by ConsoleLogg, it is defined in combination of [Laravel](https://github.com/laravel/framework/blob/8.x/src/Illuminate/Console/Concerns/InteractsWithIO.php#L43) &amp; [Symfony](https://github.com/symfony/console/blob/5.x/Logger/ConsoleLogger.php#L33)

*ConsoleLogg may provide configuration for this in the future, if demand is apparent*

VerbosityLevel*default*`emergency`, `alert`, `critical`, `error`, `warning`-v`notice` + all of above-vv`info` + all of above-vvv`debug` + all of aboveExamples
========

[](#examples)

### Running artisan

[](#running-artisan)

 View example usageExample #1 - SQL query logging
------------------------------

[](#example-1---sql-query-logging)

There are several guides/answers on the internet that enable you to send all SQL queries to your configured Logger.

With ConsoleLogg installed this means

Links (in no order):

- [Code Briefly - Seeing all SQL queries executed with your artisan command](https://codebriefly.com/how-to-log-all-sql-queries-in-laravel/)
- [StackOverflow - Laravel 5.3 - How to log all queries on a page?](https://stackoverflow.com/a/43137632)
- [Larvel Tricks - Real-time log of Eloquent SQL queries](https://laravel-tricks.com/tricks/real-time-log-of-eloquent-sql-queries)

Example #2 - Raw code
---------------------

[](#example-2---raw-code)

> ⚠️ **REMINDER:** n-o-t-h-i-n-g is special about this following code example
>
> There are no traits, interfaces, or classes/dependencies that are involved to use ConsoleLogg once it's installed.

### Souce code for example service

[](#souce-code-for-example-service)

 Source of App\\Service\\MyExampleService```
namespace App\Service;

use Illuminate\Support\Facades\Log;
use Psr\Log\LoggerInterface;

class MyExampleService {
    private $logger;
    public function __construct(LoggerInterface $logger)
    {
        $this->logger = $logger;
    }

    public function doSomethingCool(): void
    {
        // using Laravel's logger with DI/autowiring
        $this->logger->debug("A message that should have value when output to your application in general");

        // Facade
        Log::info("or just the facade if you love magic");

        // Helper function
        logger()->notice("or this weird helper function I guess");

        // ...
    }
}
```

### Source code for Console Application

[](#source-code-for-console-application)

 Source of App\\Console\\Commands\\ExampleConsole```
namespace App\Console\Commands;

use App\Service\ExampleService;
use Illuminate\Console\Command;

class ExampleConsole extends Command
{
    /**
     * The console command description.
     */
    protected $description = '';

    /**
     * The name and signature of the console command.
     */
    protected $signature = 'something';

    public function handle(ExampleService $exampleService): int
    {
        $exampleService->doSomethingCool();

        return 0;
    }
}
```

### Running artisan

[](#running-artisan-1)

 Artisan command output```
not-root@linux:~/MyProject$ php artisan something -vv
[debug] A message that should have value when output to your application in general
[info] or just the facade if you love magic
[notice] or this weird helper function I guess
```

---

License
=======

[](#license)

Laravel ConsoleLogg is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 86.7% 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.

###  Release Activity

Cadence

Every ~137 days

Recently: every ~204 days

Total

7

Last Release

1186d ago

PHP version history (3 changes)v1.0PHP 7.1.3 - 8.0

v1.2PHP 7.\*|8.\*

v1.2.1PHP &gt;=7.1|8.\*

### Community

Maintainers

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

---

Top Contributors

[![VeryStrongFingers](https://avatars.githubusercontent.com/u/7744427?v=4)](https://github.com/VeryStrongFingers "VeryStrongFingers (13 commits)")[![lfglopes](https://avatars.githubusercontent.com/u/1245319?v=4)](https://github.com/lfglopes "lfglopes (1 commits)")[![LVMade01](https://avatars.githubusercontent.com/u/99674685?v=4)](https://github.com/LVMade01 "LVMade01 (1 commits)")

---

Tags

artisanlaravellaravel-consoleloggsymfony-consolepsr-3consolesymfonylaravelloggerPSR3channelsloggconsolelogg

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/devthis-console-logg/health.svg)

```
[![Health](https://phpackages.com/badges/devthis-console-logg/health.svg)](https://phpackages.com/packages/devthis-console-logg)
```

###  Alternatives

[analog/analog

Fast, flexible, easy PSR-3-compatible PHP logging package with dozens of handlers.

3451.5M24](/packages/analog-analog)[timacdonald/log-fake

A drop in fake logger for testing with the Laravel framework.

4235.9M56](/packages/timacdonald-log-fake)[nunomaduro/laravel-console-menu

Laravel Console Menu is an output method for your Laravel/Laravel Zero commands.

815412.0k48](/packages/nunomaduro-laravel-console-menu)[laravel-zero/framework

The Laravel Zero Framework.

3371.4M369](/packages/laravel-zero-framework)[illuminated/console-logger

Logging and Notifications for Laravel Console Commands.

8674.9k](/packages/illuminated-console-logger)[ytake/laravel-aspect

Aspect Oriented Programming library for laravel framework, and lumen

138132.2k1](/packages/ytake-laravel-aspect)

PHPackages © 2026

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