PHPackages                             saasscaleup/laravel-console-log - 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. saasscaleup/laravel-console-log

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

saasscaleup/laravel-console-log
===============================

Easily stream your Laravel application logs to the browser console.log in real-time using server-sent event (SSE)

1.0.0(1y ago)6475MITPHPPHP ^7.0|^8.0

Since Jun 17Pushed 1y ago1 watchersCompare

[ Source](https://github.com/saasscaleup/laravel-console-log)[ Packagist](https://packagist.org/packages/saasscaleup/laravel-console-log)[ Docs](https://github.com/saasscaleup/laravel-console-log)[ Fund](https://buymeacoffee.com/scaleupsaas)[ GitHub Sponsors](https://github.com/saasscaleup)[ RSS](/packages/saasscaleup-laravel-console-log/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

[![Main Window two](https://github.com/saasscaleup/laravel-console-log/raw/master/lcl-saasscaleup.png?raw=true)](https://github.com/saasscaleup/laravel-console-log/blob/master/lcl-saasscaleup.png?raw=true)

Easily stream your Laravel application logs to the browser console tab (console.log) in real-time using server-sent event (SSE)
-------------------------------------------------------------------------------------------------------------------------------

[](#easily-stream-your-laravel-application-logs-to-the-browser-console-tab-consolelog-in-real-time-using-server-sent-event-sse)

#### This package lets backend developers easily print messages and values in terminal. This is the php version of console log for Laravel. Compatible with Laravel v5+.

[](#this-package-lets-backend-developers-easily-print-messages-and-values-in-terminal-this-is-the-php-version-of-console-log-for-laravelcompatible-with-laravel-v5)

####  [Youtube](https://youtube.com/@ScaleUpSaaS)  ·  [Twitter](https://twitter.com/ScaleUpSaaS)  ·  [Facebook](https://facebook.com/ScaleUpSaaS)  ·  [Buy Me a Coffee](https://buymeacoffee.com/scaleupsaas)

[](#--youtube------twitter------facebook------buy-me-a-coffee)

 [ ![Latest Stable Version](https://camo.githubusercontent.com/8176613ca696bdcd758067fd6cd9a615f507887a8d55b1d61daecd76ebfd9a7b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736161737363616c6575702f6c61726176656c2d636f6e736f6c652d6c6f672e7376673f7374796c653d666c61742d737175617265) ](https://packagist.org/packages/saasscaleup/laravel-console-log) [ ![Total Downloads](https://camo.githubusercontent.com/ea569938390b7f8fe8f90bcf95a7e01ec7b30384f1f115275a3a0ae2d8738fb4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736161737363616c6575702f6c61726176656c2d636f6e736f6c652d6c6f672e7376673f7374796c653d666c61742d737175617265) ](https://packagist.org/packages/saasscaleup/laravel-console-log) [ ![License](https://camo.githubusercontent.com/0adadc2a0d7576fe72de48727ad75d96a2cc8cdcb4078e18ce149eb697e1e795/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f736161737363616c6575702f6c61726176656c2d636f6e736f6c652d6c6f672e7376673f7374796c653d666c61742d737175617265) ](https://packagist.org/packages/saasscaleup/laravel-console-log)

✨ Features
----------

[](#-features)

- **Easily stream your Backend events from your Controllers \\ Events \\ Models \\ Etc... to Frontend browser console tab(`console.log')(data)`).**
- **Easily stream your Application Logs (`storage/logs/laravel.log`)to Frontend browser console tab (`console.log')(data)`).**

[![banner](https://github.com/saasscaleup/laravel-console-log/raw/master/lcl-demo.gif?raw=true)](https://github.com/saasscaleup/laravel-console-log/blob/master/lcl-demo.gif?raw=true)

Requirements
------------

[](#requirements)

- PHP &gt;= 7
- Laravel &gt;= 5

Installation
------------

[](#installation)

### Install composer package (dev)

[](#install-composer-package-dev)

Via Composer - Not recommended for production environment

```
composer require --dev saasscaleup/laravel-console-log
```

#### For Laravel &lt; 5.5

[](#for-laravel--55)

Add Service Provider to `config/app.php` in `providers` section

```
Saasscaleup\LCL\LCLServiceProvider::class,
```

Add Facade to `config/app.php` in `aliases` section

```
'LCL' => Saasscaleup\LCL\Facades\LCLFacade::class,
```

---

### Publish package's config, migration and view files

[](#publish-packages-config-migration-and-view-files)

Publish package's config, migration and view files by running below command:

```
php artisan vendor:publish --provider="Saasscaleup\LCL\LCLServiceProvider"
```

### Run migration command

[](#run-migration-command)

Run `php artisan migrate` to create `stream_console_logs` table.

```
php artisan migrate
```

Setup Laravel Console Log -&gt; LCL
-----------------------------------

[](#setup-laravel-console-log---lcl)

Add this in your main view/layout (usually `layout/app.blade.php`) file before :

```
@include('lcl::view')
```

```

...
@include('lcl::view')

```

Configuration
-------------

[](#configuration)

Configuration is done via environment variables or directly in the configuration file (`config/lcl.php`).

```
