PHPackages                             tfo/advanced-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. tfo/advanced-log

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

tfo/advanced-log
================

Advanced logging system for Laravel with Slack, Sentry and DataDog integration

v1.9.4(1y ago)038MITPHPPHP ^8.1

Since Jan 23Pushed 1y ago1 watchersCompare

[ Source](https://github.com/thallesfreitas/advanced-log)[ Packagist](https://packagist.org/packages/tfo/advanced-log)[ RSS](/packages/tfo-advanced-log/feed)WikiDiscussions master Synced 1mo ago

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

README.md
=========

[](#readmemd)

Advanced Logger for Laravel
===========================

[](#advanced-logger-for-laravel)

[Leia em Português](README-pt-BR.md)

Advanced logging system for Laravel applications with integrated support for Slack, Sentry, and DataDog (Soon).

[![Latest Version on Packagist](https://camo.githubusercontent.com/fa96bd532457b5e68acf4c176cc5d9f5e3cc05af4fc94dd7a39ee0807777a265/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f74666f2f616476616e6365642d6c6f672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tfo/advanced-log)[![Total Downloads](https://camo.githubusercontent.com/e4d2f00c3b28458def336e21547cc845a63e7c51450bde708d11007ee58bebc9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f74666f2f616476616e6365642d6c6f672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tfo/advanced-log)[![License](https://camo.githubusercontent.com/244420d2a0caad6b9c238936c497d9c1d5edffd576c9c420b370929ae58d6e54/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f74666f2f616476616e6365642d6c6f672e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

Features
--------

[](#features)

- 🚀 Simple and intuitive API
- 📱 Real-time Slack notifications
- 🔍 Sentry error tracking integration
- 📊 DataDog metrics support
- 🎨 Customizable message formatting
- ⚡ Multiple notification channels
- 🔒 Secure credentials handling
- 🛠 Simplified configuration

Log Destinations
----------------

[](#log-destinations)

Logs are sent to:

- Local file (storage/logs/laravel.log)
- Slack (via webhook)
- Sentry (if configured)
- DataDog (if configured) SOON

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

[](#requirements)

- PHP ^8.1
- Laravel ^10.0|^11.0

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

[](#installation)

You can install the package via composer:

```
composer require tfo/advanced-log
```

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

[](#configuration)

1. Publish the configuration file:

```
php artisan advanced-log:install
```

The installer will:

Publish configurations Copy loggers to app/Loggers Install ServiceProvider Add .env variables Publish test routes

2. Add these variables to your `.env` file:

```
# Slack Configuration
LOGGER_SLACK_WEBHOOK_URL=your-webhook-url
LOGGER_SLACK_CHANNEL=#your-channel
LOGGER_SLACK_USERNAME=LoggerBot

# Sentry Configuration
LOGGER_SENTRY_DSN=your-sentry-dsn

# DataDog Configuration
LOGGER_DATADOG_API_KEY=your-api-key
LOGGER_DATADOG_APP_KEY=your-app-key
LOGGER_DATADOG_SERVICE=your-service-name

# Enable/Disable Services
LOGGER_ENABLE_SLACK=true
LOGGER_ENABLE_SENTRY=true
LOGGER_ENABLE_DATADOG=true
```

Usage
-----

[](#usage)

Log Types and Usage
-------------------

[](#log-types-and-usage)

**Test Log Levels**Standard Laravel log levels. Use to test basic logging functionality.

**Performance Log**Monitor execution times and bottlenecks. Use for:

- Long-running processes
- Database queries
- API calls
- Critical user flows

**Audit Log**Track data changes. Use for:

- User modifications
- Permission changes
- Critical record updates
- Configuration changes

**Security Log**Monitor security events. Use for:

- Login attempts
- Permission changes
- Suspicious activities
- Access violations

**API Log**Track API interactions. Use for:

- External service calls
- Endpoint monitoring
- Integration debugging
- API performance

**Database Log**Monitor database operations. Use for:

- Critical data changes
- Schema updates
- Bulk operations
- Data integrity checks

**Job Log**Track background tasks. Use for:

- Queue processing
- Scheduled tasks
- Long-running jobs
- Failed job analysis

**Cache Log**Monitor cache operations. Use for:

- Cache hits/misses
- Cache invalidation
- Memory usage
- Performance optimization

**Request Log**Track HTTP requests. Use for:

- Important endpoints
- User interactions
- Error tracking
- Performance monitoring

**Payment Log**Monitor financial transactions. Use for:

- Payment processing
- Refunds
- Subscription changes
- Payment errors

**Notification Log**Track communication events. Use for:

- Email sending
- SMS delivery
- Push notifications
- Communication errors

**File Log**Monitor file operations. Use for:

- File uploads
- Downloads
- Storage operations
- File processing

**Auth Log**Track authentication events. Use for:

- Login/logout
- Password resets
- 2FA events
- Session management

**Export Log**Monitor data exports. Use for:

- Report generation
- Bulk downloads
- Data migrations
- Export errors

### Basic Logging

[](#basic-logging)

```
use Illuminate\Support\Facades\Log;

Log::emergency('Emergency log test', ['context' => 'test']);
Log::alert('Alert log test', ['context' => 'test']);
Log::critical('Critical log test', ['context' => 'test']);
Log::error('Error log test', ['context' => 'test']);
Log::warning('Warning log test', ['context' => 'test']);
Log::notice('Notice log test', ['context' => 'test']);
Log::info('Info log test', ['context' => 'test']);
Log::debug('Debug log test', ['context' => 'test']);
```

### Advanced Logging

[](#advanced-logging)

```
use Tfo\AdvancedLog\Support\ALog;
```

### Performance Logging

[](#performance-logging)

```
$startTime = microtime(true);
// Your code here
$duration = (microtime(true) - $startTime) * 1000;
ALog::performance('Process Order', $duration, [
    'order_id' => 123
]);
```

### Audit Logging

[](#audit-logging)

```
ALog::audit('update', 'User', 1, [
    'name' => ['old' => 'John', 'new' => 'Johnny'],
    'email' => ['old' => 'john@example.com', 'new' => 'johnny@example.com']
]);
```

### Security Logging

[](#security-logging)

```
ALog::security('Login Failed', [
    'email' => 'user@example.com',
    'attempts' => 3
]);
```

### API Logging

[](#api-logging)

```
$response = response()->json(['status' => 'success']);
ALog::api('/api/users', 'GET', $response, 150.5);
```

### Database Logging

[](#database-logging)

```
ALog::database('create', 'users', 1, [
    'data' => ['name' => 'John', 'email' => 'john@example.com']
]);
```

### Job Logging

[](#job-logging)

```
ALog::job('SendWelcomeEmail', 'completed', [
    'user_id' => 1,
    'duration' => 1500
]);
```

### Cache Logging

[](#cache-logging)

```
ALog::cache('hit', 'user:123', [
    'ttl' => 3600
]);
```

### Request Logging

[](#request-logging)

```
ALog::request('API Request', [
    'endpoint' => '/api/users',
    'params' => ['page' => 1]
]);
```

### Payment Logging

[](#payment-logging)

```
ALog::payment('success', 99.99, 'stripe', [
    'transaction_id' => 'tx_123'
]);
```

### Notification Logging

[](#notification-logging)

```
ALog::notification('email', 'user@example.com', 'welcome', [
    'template' => 'welcome-email'
]);
```

### File Logging

[](#file-logging)

```
ALog::file('upload', 'images/profile.jpg', [
    'size' => '2.5MB',
    'type' => 'image/jpeg'
]);
```

### Auth Logging

[](#auth-logging)

```
ALog::auth('login_success', [
    'remember' => true,
    'device' => 'iPhone 13'
]);
```

### Export Logging

[](#export-logging)

```
ALog::export('users', 1000, [
    'format' => 'csv',
    'filters' => ['status' => 'active']
]);
```

Channels
--------

[](#channels)

### Slack

[](#slack)

Messages are sent to Slack with:

- Emojis indicating log level
- Color-coded messages
- Structured context fields
- Custom channel support

### Sentry

[](#sentry)

Errors are tracked in Sentry with:

- Full stack traces
- Environment information
- User context
- Custom tags and breadcrumbs

### DataDog

[](#datadog)

Metrics are sent to DataDog with:

- Custom metrics
- Tagging
- Event aggregation
- Performance tracking

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md) for more information about recent changes.

Contributing
------------

[](#contributing)

See [CONTRIBUTING.md](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security-related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Thalles Freitas](https://github.com/thallesfreitas)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance42

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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 ~0 days

Total

90

Last Release

479d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5650a57c1a1ba235f26b443d652d15c5e0581edbbe8cffbf4270a4d0f5d8b037?d=identicon)[thallesfreitas](/maintainers/thallesfreitas)

---

Top Contributors

[![thallesfreitas](https://avatars.githubusercontent.com/u/272439?v=4)](https://github.com/thallesfreitas "thallesfreitas (90 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tfo-advanced-log/health.svg)

```
[![Health](https://phpackages.com/badges/tfo-advanced-log/health.svg)](https://phpackages.com/packages/tfo-advanced-log)
```

###  Alternatives

[overtrue/laravel-query-logger

A dev tool to log all queries for laravel application.

413307.5k6](/packages/overtrue-laravel-query-logger)[guanguans/laravel-exception-notify

Monitor exception and report to the notification channels(Log、Mail、AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

14642.7k1](/packages/guanguans-laravel-exception-notify)

PHPackages © 2026

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