PHPackages                             401clicks/laravel-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. 401clicks/laravel-logger

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

401clicks/laravel-logger
========================

Laravel logging driver for 401 Clicks - Simple log aggregation and monitoring

v1.0.2(5mo ago)1523↓28.6%MITPHPPHP ^8.1

Since Jan 30Pushed 5mo agoCompare

[ Source](https://github.com/401Clicks/laravel-logger)[ Packagist](https://packagist.org/packages/401clicks/laravel-logger)[ RSS](/packages/401clicks-laravel-logger/feed)WikiDiscussions main Synced yesterday

READMEChangelog (2)Dependencies (5)Versions (4)Used By (0)

401 Clicks Laravel Logger
=========================

[](#401-clicks-laravel-logger)

Simple log aggregation for Laravel applications. Send your logs to 401 Clicks with just a few environment variables.

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

[](#installation)

```
composer require 401Clicks/laravel-logger
```

Quick Start
-----------

[](#quick-start)

Add these to your `.env` file:

```
LOG_CHANNEL=stack
LOG_STACK=single,clicks

CLICKS_API_TOKEN=your-api-token-here
```

That's it! Your logs will now be sent to 401 Clicks.

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

[](#configuration)

### Environment Variables

[](#environment-variables)

VariableDescriptionDefault`CLICKS_API_TOKEN`Your API token from project settings*required*`CLICKS_LOG_URL`API endpoint (for self-hosted)`https://logs.401clicks.com/api/v1/logs``CLICKS_LOG_LEVEL`Minimum log level to send`debug``CLICKS_BATCH_SIZE`Number of logs to batch`10``CLICKS_FLUSH_INTERVAL`Max seconds between flushes`5``CLICKS_MASKING_ENABLED`Enable/disable data masking`true``CLICKS_MASKING_STYLE`Masking style: `full`, `partial`, or `hash``full`### Publishing Config

[](#publishing-config)

To customize the configuration:

```
php artisan vendor:publish --tag=clicks-logger-config
```

### Manual Channel Configuration

[](#manual-channel-configuration)

If you prefer to configure the channel manually in `config/logging.php`:

```
'channels' => [
    // ... other channels

    'clicks' => [
        'driver' => 'clicks',
        'url' => env('CLICKS_LOG_URL', 'https://logs.401clicks.com/api/v1/logs'),
        'token' => env('CLICKS_API_TOKEN'),
        'level' => env('CLICKS_LOG_LEVEL', 'debug'),
    ],
],
```

Usage
-----

[](#usage)

Once configured, just use Laravel's standard logging:

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

Log::info('User logged in', ['user_id' => $user->id]);
Log::error('Payment failed', ['order_id' => $order->id, 'error' => $e->getMessage()]);
```

### Using with Stack Channel

[](#using-with-stack-channel)

The recommended setup uses Laravel's stack channel to log locally AND send to 401 Clicks:

```
LOG_CHANNEL=stack
LOG_STACK=single,clicks
```

This way you keep local logs while also sending them to 401 Clicks.

### Logging to Clicks Only

[](#logging-to-clicks-only)

To only send logs to 401 Clicks:

```
LOG_CHANNEL=clicks
```

Sensitive Data Masking
----------------------

[](#sensitive-data-masking)

The logger automatically masks sensitive data **before** it leaves your application. This is the most secure approach as PII and credentials never reach any external service.

### Default Behavior

[](#default-behavior)

By default, masking is **enabled** and will detect and mask:

- Credit card numbers (Visa, MasterCard, Amex, Discover, JCB)
- Social Security Numbers (XXX-XX-XXXX format)
- API keys (sk\_*, pk\_*, Bearer tokens)
- Passwords in key-value contexts
- Phone numbers (US formats)

### Configuration

[](#configuration-1)

Configure masking via environment variables or the config file:

```
# Disable masking entirely (not recommended)
CLICKS_MASKING_ENABLED=false

# Change masking style: full, partial, or hash
CLICKS_MASKING_STYLE=full
```

Available masking styles:

StyleExample InputExample Output`full` (default)`4111111111111111``[CREDIT_CARD]``partial``4111111111111111``****1111``hash``4111111111111111``[a3f8b2c1]`### Custom Patterns

[](#custom-patterns)

Add custom patterns in your `config/clicks-logger.php`:

```
'masking' => [
    'custom_patterns' => [
        [
            'name' => 'Customer IDs',
            'pattern' => '/CUST-[A-Z0-9]{8}/i',
            'replacement' => '[CUSTOMER_ID]',
        ],
        [
            'name' => 'Internal Order Numbers',
            'pattern' => '/ORD-\d{10}/',
            'replacement' => '[ORDER_ID]',
        ],
    ],
],
```

### Enabling Additional Patterns

[](#enabling-additional-patterns)

To mask email addresses or IP addresses, update the `patterns` array:

```
'masking' => [
    'patterns' => [
        'credit_cards',
        'ssn',
        'api_keys',
        'passwords',
        'phone_numbers',
        'emails',       // Now enabled
        'ip_addresses', // Now enabled
    ],
],
```

### Server-Side Fallback

[](#server-side-fallback)

401 Clicks also provides server-side masking for logs sent via cURL or other methods that don't use this package. Configure server-side masking in your project settings at 401clicks.com.

How It Works
------------

[](#how-it-works)

- Logs are batched (default: 10 logs or 5 seconds)
- Sensitive data is masked before batching (client-side)
- Batches are sent via HTTP POST to the 401 Clicks API
- Failed sends are logged to stderr (won't break your app)
- Remaining logs are flushed on shutdown

Getting Your API Token
----------------------

[](#getting-your-api-token)

1. Go to [401clicks.com](https://401clicks.com)
2. Navigate to your project settings
3. Create a new API token
4. Copy the token to your `.env` file

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

[](#requirements)

- PHP 8.1+
- Laravel 10, 11, or 12
- Guzzle HTTP client

License
-------

[](#license)

MIT License

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance73

Regular maintenance activity

Popularity18

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

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

Total

3

Last Release

153d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/257429238?v=4)[401Clicks](/maintainers/401Clicks)[@401Clicks](https://github.com/401Clicks)

---

Top Contributors

[![401Clicks](https://avatars.githubusercontent.com/u/257429238?v=4)](https://github.com/401Clicks "401Clicks (4 commits)")

---

Tags

laravelloggingmonitoringlog-aggregation401clicks

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/401clicks-laravel-logger/health.svg)

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M164](/packages/spatie-laravel-health)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[illuminate/log

The Illuminate Log package.

6225.3M622](/packages/illuminate-log)[honeybadger-io/honeybadger-laravel

Honeybadger Laravel integration

431.3M](/packages/honeybadger-io-honeybadger-laravel)[naoray/laravel-github-monolog

Log driver to store logs as github issues

10823.1k](/packages/naoray-laravel-github-monolog)

PHPackages © 2026

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