PHPackages                             fragly/laravel-extended-logger - 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. fragly/laravel-extended-logger

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

fragly/laravel-extended-logger
==============================

Advanced Laravel logger with database, Discord, Telegram, and Slack support.

v1.0.0(6mo ago)00MITPHPPHP &gt;=8.2

Since Oct 26Pushed 6mo agoCompare

[ Source](https://github.com/cristalNichita/laravel-extended-logger)[ Packagist](https://packagist.org/packages/fragly/laravel-extended-logger)[ RSS](/packages/fragly-laravel-extended-logger/feed)WikiDiscussions main Synced 1mo ago

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

[![Packagist Version](https://camo.githubusercontent.com/808797456488606e42964f3e072ca8cfbcb7c0af1f10cd55d0475aa1f755c662/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f667261676c792f6c61726176656c2d657874656e6465642d6c6f676765722e7376673f636f6c6f723d627269676874677265656e)](https://packagist.org/packages/fragly/laravel-extended-logger)[![Laravel](https://camo.githubusercontent.com/36ab9eb40d419c375ec1c19e6d5fd0d5ae0aeb01372cc6b164966c412feecdad/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31302532422d7265642e737667)](https://laravel.com)[![Downloads](https://camo.githubusercontent.com/aa603b786b6ce6b6084729d963fe28e612d39ddc9941514916a74cba8572c342/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f667261676c792f6c61726176656c2d657874656e6465642d6c6f676765722e7376673f636f6c6f723d627269676874677265656e)](https://packagist.org/packages/fragly/laravel-extended-logger)[![License](https://camo.githubusercontent.com/040ea87810c855df541c02dff794055a3c77d512d0dd260415124f5ca1653035/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6372697374616c4e6963686974612f6c61726176656c2d657874656e6465642d6c6f676765722e737667)](https://github.com/cristalNichita/laravel-extended-logger/blob/main/LICENSE)[![Sponsor](https://camo.githubusercontent.com/9e426f5cf6f1022ee8a2c1e21e8616cf0934f2300e537546b444ce13a6278a68/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53706f6e736f722d50617472656f6e2d6666343234643f6c6f676f3d70617472656f6e)](https://www.patreon.com/c/FraglyDev)

> Compare and safely synchronize your `.env` with `.env.example`.
> Perfect for **CI/CD pipelines**, **team development**, and **clean environments**.

Contents
--------

[](#contents)

- [Features](#-features)
- [Installation](#-installation)
- [Usage](#-usage)
- [Automatic Context](#-automatic-context)
- [Log Table Migration](#-log-table-migration)
- [Default Configuration](#-default-configuration)
- [Example Output (Discord)](#-example-output-discord)
- [Laravel Compatibility](#-laravel-compatibility)
- [About the Author](#-about-the-author)
- [License](#-license)

📄 Laravel Extended Logger
=========================

[](#-laravel-extended-logger)

> 💡 Advanced Laravel logger that writes to Database, Discord, Telegram, and Slack — with request context (`IP`, `user_id`, `route`).
> Replaces the monotonous Monolog output with clean, human-readable developer logs.

---

🚀 Features
----------

[](#-features)

- 📦 Multi-channel support:

    - **Database** — saves logs into `extended_logs` table
    - **Discord** — sends logs to a Discord channel via webhook
    - **Telegram** — sends logs to a chat/group/channel via Bot API
    - **Slack** — sends logs via Slack webhook (optional)
- 🧠 Automatic context enrichment:

    - Request IP address
    - Authenticated user ID
    - Current route or URI
- 🪶 Clean, human-readable formatting
- ⚙️ Fully configurable via `.env`
- 💥 Compatible with Laravel 10, 11, and 12

---

⚙️ Installation
---------------

[](#️-installation)

### 1. Install via Composer

[](#1-install-via-composer)

```
composer require vendor/laravel-extended-logger

```

### 2. Publish config and migrations

[](#2-publish-config-and-migrations)

```
php artisan vendor:publish --tag=extended-logger-config
php artisan vendor:publish --tag=extended-logger-migrations
php artisan migrate

```

### 3. Add a logging channel

[](#3-add-a-logging-channel)

In your `config/logging.php` file:

```
'channels' => [
    'extended' => [
        'driver' => 'extended',
    ],

    'stack' => [
        'driver' => 'stack',
        'channels' => ['extended', 'single'],
        'ignore_exceptions' => true,
    ],
]

```

### 4. Configure your `.env`

[](#4-configure-your-env)

```
# Database
EXTLOG_TABLE=extended_logs
EXTLOG_DB_LEVEL=debug

# Discord
EXTLOG_DISCORD_WEBHOOK=https://discord.com/api/webhooks/xxx/yyy
EXTLOG_DISCORD_LEVEL=notice

# Telegram
EXTLOG_TELEGRAM_BOT_TOKEN=123456:AA...
EXTLOG_TELEGRAM_CHAT_ID=123456789
EXTLOG_TELEGRAM_LEVEL=warning
EXTLOG_TELEGRAM_PARSE_MODE=none

# Slack
EXTLOG_SLACK_WEBHOOK=https://hooks.slack.com/services/xxx/yyy/zzz
EXTLOG_SLACK_LEVEL=error

```

⚠️ Note: Log level (\*\_LEVEL) defines the minimum severity threshold. For example:

- notice → catches everything from notice and above (warning, error, etc.)
- error → catches only error, critical, alert, emergency
- debug → catches everything

🧰 Usage
-------

[](#-usage)

```
// default logger (if 'extended' is the default channel)
logger()->warning('Payment failed', ['order_id' => 123]);

// specific channel
app('log')->channel('extended')->error('Telegram error report', [
    'feature' => 'payments',
    'env' => app()->environment(),
]);

```

Messages are automatically sent to:

- Database (extended\_logs)
- Discord (if enabled)
- Telegram (if enabled)
- Slack (if enabled)

🧠 Automatic Context
-------------------

[](#-automatic-context)

Each log entry automatically includes:

- `ip` - the client IP
- `user_id` - the authenticated user ID (if available)
- `route` - the current request path

### Example DB Record

[](#example-db-record)

```
{
  "level": "warning",
  "message": "Payment failed",
  "context": {"order_id":123},
  "extra": {"ip":"127.0.0.1","user_id":1,"route":"payments/process"}
}

```

💾 Log Table Migration
---------------------

[](#-log-table-migration)

```
Schema::create('extended_logs', function (Blueprint $table) {
    $table->id();
    $table->string('level', 32);
    $table->text('message');
    $table->json('context')->nullable();
    $table->json('extra')->nullable();
    $table->string('ip', 64)->nullable();
    $table->unsignedBigInteger('user_id')->nullable();
    $table->string('route')->nullable();
    $table->timestamps();
});

```

🧩 Default Configuration
-----------------------

[](#-default-configuration)

`config/extended-logger.php`

```
return [
    'channels' => [
        'database' => true,
        'discord'  => env('EXTLOG_DISCORD_WEBHOOK') !== null,
        'telegram' => env('EXTLOG_TELEGRAM_BOT_TOKEN') && env('EXTLOG_TELEGRAM_CHAT_ID'),
        'slack'    => env('EXTLOG_SLACK_WEBHOOK') !== null,
    ],

    'levels' => [
        'database' => env('EXTLOG_DB_LEVEL', 'debug'),
        'discord'  => env('EXTLOG_DISCORD_LEVEL', 'warning'),
        'telegram' => env('EXTLOG_TELEGRAM_LEVEL', 'error'),
        'slack'    => env('EXTLOG_SLACK_LEVEL', 'notice'),
    ],

    'table' => env('EXTLOG_TABLE', 'extended_logs'),

    'discord_webhook'  => env('EXTLOG_DISCORD_WEBHOOK'),
    'slack_webhook'    => env('EXTLOG_SLACK_WEBHOOK'),

    'telegram' => [
        'bot_token'  => env('EXTLOG_TELEGRAM_BOT_TOKEN'),
        'chat_id'    => env('EXTLOG_TELEGRAM_CHAT_ID'),
        'parse_mode' => env('EXTLOG_TELEGRAM_PARSE_MODE', 'none'),
    ],

    'format' => "[%datetime%] %level_name%: %message% %context% %extra%\n",

    'enrich_request_context' => true,
];

```

🧾 Example Output (Discord)
--------------------------

[](#-example-output-discord)

| WARNING: Rate limit hit
| `2025-10-26 14:41:36`
| ip: 127.0.0.1 | route: / | ctx: {"key":"steam\_api"}

🧱 Laravel Compatibility
-----------------------

[](#-laravel-compatibility)

LaravelSupported10.x✅11.x✅12.x✅🧑‍💻 About the Author
--------------------

[](#‍-about-the-author)

Fragly Dev — Building tools for modern Laravel &amp; Next.js developers. Follow for more developer utilities, security helpers, and SaaS-ready boilerplates.

📜 License
---------

[](#-license)

This package is open-sourced software licensed under the MIT license.

---

🔍 SEO Keywordslaravel logger package, laravel logging channels, laravel custom log driver,
laravel discord logs, laravel telegram logs, laravel slack integration,
laravel database logging, laravel error tracker, laravel error reporting,
laravel monolog replacement, laravel advanced logging, laravel log formatter,
laravel request context logger, laravel log to database, laravel log to discord,
laravel log to telegram, laravel log to slack, laravel extended logger,
laravel contextual logs, laravel log middleware, laravel devops tools,
laravel production logs, laravel debugging utilities, laravel log management,
laravel error monitoring, laravel discord webhook, laravel telegram bot logs,
laravel slack webhook logs, laravel notification logs, fragly laravel logger,
fragly extended logger, fragly.net laravel packages

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance66

Regular maintenance activity

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

198d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/35386c64c66e4e25c7b4c63c365aeb98f77e3d9564e73c581990639efa4e7039?d=identicon)[FraglyDev](/maintainers/FraglyDev)

### Embed Badge

![Health badge](/badges/fragly-laravel-extended-logger/health.svg)

```
[![Health](https://phpackages.com/badges/fragly-laravel-extended-logger/health.svg)](https://phpackages.com/packages/fragly-laravel-extended-logger)
```

###  Alternatives

[spatie/laravel-activitylog

A very simple activity logger to monitor the users of your website or application

5.8k45.4M309](/packages/spatie-laravel-activitylog)[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)[larabug/larabug

Laravel 6.x/7.x/8.x/9.x/10.x/11.x/12.x/13.x bug notifier

299549.3k1](/packages/larabug-larabug)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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