PHPackages                             aaix/laravel-smart-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. aaix/laravel-smart-log

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

aaix/laravel-smart-log
======================

Context-aware logging wrapper for Laravel applications

v1.0.4(5mo ago)076MITPHPPHP &gt;=8.2

Since Dec 25Pushed 5mo agoCompare

[ Source](https://github.com/jonaaix/laravel-smart-log)[ Packagist](https://packagist.org/packages/aaix/laravel-smart-log)[ RSS](/packages/aaix-laravel-smart-log/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (4)Versions (6)Used By (0)

 [ ![Laravel SmartLog Logo](https://raw.githubusercontent.com/jonaaix/laravel-smart-log/refs/heads/main/docs/logo.webp) ](https://github.com/jonaaix/laravel-smart-log)

Laravel SmartLog
================

[](#laravel-smartlog)

Context-aware logging wrapper for Laravel applications.

 [ ![Latest Version on Packagist](https://camo.githubusercontent.com/f9bd2309283845e89750dc955c6ae7a71d7ed600932f7e1e0ea079038a88e4e2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616169782f6c61726176656c2d736d6172742d6c6f672e7376673f7374796c653d666c61742d737175617265) ](https://packagist.org/packages/aaix/laravel-smart-log) [ ![Total Downloads](https://camo.githubusercontent.com/62055f58f3acb40be0457c2604848362eaa39a3d6fe56b252066f691e62eabb3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616169782f6c61726176656c2d736d6172742d6c6f672e7376673f7374796c653d666c61742d737175617265) ](https://packagist.org/packages/aaix/laravel-smart-log) [ ![License](https://camo.githubusercontent.com/73f6265df234f52456ba1f3c6fb53faaaff60b3359f8e73b1c185e679bc802ff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f616169782f6c61726176656c2d736d6172742d6c6f672e7376673f7374796c653d666c61742d737175617265) ](https://github.com/jonaaix/laravel-smart-log/blob/main/LICENSE)

SmartLog solves a common problem in Laravel CLI development: You want visual feedback in your terminal (colors, progress), but you don't want to clutter your production log files (`laravel.log`, Sentry, Slack) with developer noise.

SmartLog intelligently routes your messages based on context (CLI vs. Web) and configuration.

---

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

[](#installation)

```
composer require aaix/laravel-smart-log
```

Usage
-----

[](#usage)

Use `SmartLog` anywhere in your code. It automatically detects if it's running inside an Artisan command or a web request.

```
use Aaix\SmartLog\SmartLog;

// 1. Standard Output (CLI: White | File: Ignored)
// Perfect for progress bars, raw data dumps, or steps.
SmartLog::log('Importing users step 1 of 5...');

// 2. Developer Output (CLI: Gray | File: Ignored)
// Subtle output for debugging.
SmartLog::debug('Memory usage: 12MB');

// 3. Operational Info (CLI: Cyan | File: Ignored by default)
// Good for status updates that don't need permanent storage.
SmartLog::info('User 123 imported successfully.');
SmartLog::success('All operations finished.'); // Alias for info with green color

// 4. Issues (CLI: Yellow/Red | File: LOGGED)
// These are automatically sent to your default log channel (File, Sentry, etc.)
SmartLog::warning('API rate limit approaching.');
SmartLog::error('Connection failed, retrying...');

// 5. Block Styles (CLI: Large Blocks | File: LOGGED)
// Visually dominant blocks for critical start/stop events.
SmartLog::successBlock('DEPLOYMENT COMPLETE');
SmartLog::errorBlock('CRITICAL SYSTEM FAILURE');
```

How it works
------------

[](#how-it-works)

MethodCLI Output (Visual)Log File (Persistence)`log()`White text❌ (Ignored)`debug()`Gray text (subtle)❌ (Ignored)`info()`Cyan text❌ (Ignored\*)`success()`Green text❌ (Ignored\*)`warning()`Yellow text✅ **Logged** (warning)`error()`Red text✅ **Logged** (error)\**Default configuration. You can enable persistence for info/debug levels in the config file.*

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

[](#configuration)

By default, only `warning` and `error` levels are written to the log file. Everything else remains visual-only in the console.

To change this, publish the configuration file:

```
php artisan vendor:publish --tag=smart-log-config
```

**config/smart-log.php**

```
return [
    'persist_levels' => [
        'error',
        'warning',
        // Add 'info' here to save info() and success() calls to the log file
    ],
];
```

Web Context Behavior
--------------------

[](#web-context-behavior)

If you use `SmartLog` within a Controller or Job (non-CLI):

- **Visual Output:** Skipped (no `echo` or `print`).
- **Persistence:** Respects the config. `SmartLog::error()` will log to the file. `SmartLog::log()` will do nothing.

Testing
-------

[](#testing)

Run the test command:

```
./vendor/bin/testbench smartlog:test
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance70

Regular maintenance activity

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~3 days

Total

5

Last Release

178d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8d8ec042829e0d4060243b6c1067768dd31773ace52982c6ac4a4fbef207cbfd?d=identicon)[aaix](/maintainers/aaix)

---

Top Contributors

[![jonaaix](https://avatars.githubusercontent.com/u/15804690?v=4)](https://github.com/jonaaix "jonaaix (10 commits)")

### Embed Badge

![Health badge](/badges/aaix-laravel-smart-log/health.svg)

```
[![Health](https://phpackages.com/badges/aaix-laravel-smart-log/health.svg)](https://phpackages.com/packages/aaix-laravel-smart-log)
```

###  Alternatives

[laravel/sail

Docker files for running a basic Laravel application.

1.9k205.7M1.3k](/packages/laravel-sail)[spatie/laravel-medialibrary

Associate files with Eloquent models

6.1k43.2M632](/packages/spatie-laravel-medialibrary)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.6k29.9M146](/packages/laravel-cashier)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M132](/packages/laravel-pulse)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[livewire/flux

The official UI component library for Livewire.

9527.8M127](/packages/livewire-flux)

PHPackages © 2026

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