Download the PHP package 401clicks/laravel-logger without Composer
On this page you can find all versions of the php package 401clicks/laravel-logger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download 401clicks/laravel-logger
More information about 401clicks/laravel-logger
Files in 401clicks/laravel-logger
Package laravel-logger
Short Description Laravel logging driver for 401 Clicks - Simple log aggregation and monitoring
License MIT
Informations about the package 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
Quick Start
Add these to your .env file:
That's it! Your logs will now be sent to 401 Clicks.
Configuration
Environment Variables
| Variable | Description | Default |
|---|---|---|
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
To customize the configuration:
Manual Channel Configuration
If you prefer to configure the channel manually in config/logging.php:
Usage
Once configured, just use Laravel's standard logging:
Using with Stack Channel
The recommended setup uses Laravel's stack channel to log locally AND send to 401 Clicks:
This way you keep local logs while also sending them to 401 Clicks.
Logging to Clicks Only
To only send logs to 401 Clicks:
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
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
Configure masking via environment variables or the config file:
Available masking styles:
| Style | Example Input | Example Output |
|---|---|---|
full (default) |
4111111111111111 |
[CREDIT_CARD] |
partial |
4111111111111111 |
****1111 |
hash |
4111111111111111 |
[a3f8b2c1] |
Custom Patterns
Add custom patterns in your config/clicks-logger.php:
Enabling Additional Patterns
To mask email addresses or IP addresses, update the patterns array:
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
- 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
- Go to 401clicks.com
- Navigate to your project settings
- Create a new API token
- Copy the token to your
.envfile
Requirements
- PHP 8.1+
- Laravel 10, 11, or 12
- Guzzle HTTP client
License
MIT License
All versions of laravel-logger with dependencies
illuminate/support Version ^10.0|^11.0|^12.0
monolog/monolog Version ^3.0
guzzlehttp/guzzle Version ^7.0