Download the PHP package frddl/laravel-simple-logging without Composer
On this page you can find all versions of the php package frddl/laravel-simple-logging. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-simple-logging
Laravel Simple Logging
An elegant solution for monitoring your Laravel application's actual flow with comprehensive logging of warnings, infos, debug variables, and performance metrics. Features automatic method wrapping and a beautiful web interface for real-time application monitoring.
Features
- ๐ฏ Real-Time Application Flow Monitoring - Track your app's actual execution flow with comprehensive logging
- โ ๏ธ Smart Warning & Info Logging - Automatically capture warnings, infos, and debug variables throughout your application
- ๐ Advanced Debug Variable Tracking - Monitor complex data structures, arrays, objects, and variables in real-time
- โ Automatic Method Wrapping - Wrap any method with start/end logging for complete flow visibility
- ๐จ Beautiful Web Interface - Modern, responsive log viewer with advanced filtering and search
- ๐ Request Tracing - Group all logs by request ID for easy debugging and flow analysis
- ๐ Performance Monitoring - Automatic duration and memory usage tracking for optimization
- ๐จ Intelligent Error Handling - Automatic exception logging with detailed stack traces
- ๐ Sensitive Data Sanitization - Automatically masks passwords, tokens, and sensitive information
- ๐พ Flexible Storage - Store logs in database and/or files with configurable retention
- ๐ Zero Dependencies - Works with any data structure and Laravel version
- ๐ฑ Mobile Responsive - Beautiful interface on all devices for monitoring on-the-go
๐ฏ Perfect for Application Flow Monitoring
This package is specifically designed for monitoring your Laravel application's actual execution flow. It excels at:
- ๐ Debug Variable Tracking - Monitor complex data structures, arrays, objects, and variables as they flow through your application
- โ ๏ธ Warning & Info Capture - Automatically log warnings, infos, and debug messages with full context
- ๐ Real-Time Flow Analysis - See exactly how your application processes requests, with timing and memory usage
- ๐จ Exception Tracking - Capture and analyze errors with complete stack traces and variable states
- ๐ Request Tracing - Follow a single request through your entire application stack
- ๐ Performance Insights - Identify bottlenecks and optimize your application based on real usage data
Perfect for debugging complex business logic, monitoring API responses, tracking user interactions, and understanding your application's behavior in production.
Installation
Publish the config file and migrations:
Run the migrations:
Quick Start
1. Add the trait to your controller:
2. Wrap your methods with automatic logging:
3. Add comprehensive monitoring with debug variables:
Configuration
Edit config/simple-logging.php:
Log Cleanup & Maintenance
The package includes automatic log cleanup to prevent database bloat:
Automatic Cleanup
- Scheduled Daily - Runs automatically at 2:00 AM daily
- Configurable Retention - Keep logs for specified days (default: 30 days)
- Background Processing - Runs without blocking your application
Manual Cleanup
Configuration
Disable Cleanup
Set the cleanup days to null or 0 to disable automatic cleanup:
Usage
Automatic Method Logging
The logMethod function automatically logs:
- Method start with input data
- Method completion with duration and memory usage
- Any exceptions with stack traces
Direct Logging for Application Flow Monitoring
Monitor your application's execution flow with detailed logging:
Log Levels
emergency- System is unusablealert- Action must be taken immediatelycritical- Critical conditionserror- Error conditionswarning- Warning conditionsnotice- Normal but significant conditionsinfo- Informational messages (default)debug- Debug-level messages
Web Interface
Access the log viewer at: http://your-app.com/logs
Features:
- Request Tracing - See all logs grouped by request
- Advanced Filtering - Filter by level, date, search terms
- Real-time Viewing - Beautiful, responsive interface
- Performance Metrics - Duration and memory usage tracking
- Mobile Friendly - Works perfectly on all devices
Disable Logging
Environment Variable (Recommended):
Or in code:
API Endpoints
GET /logs- Web interfaceGET /logs/api- JSON API for logsGET /logs/api/statistics- Log statisticsGET /logs/api/property-keys- Available property keys
Sensitive Data Sanitization
The package automatically sanitizes sensitive data:
Performance
- Minimal Overhead - Only logs when enabled
- Efficient Storage - Optimized database queries
- Memory Conscious - Tracks memory usage
- Configurable Cleanup - Automatic old log removal
Examples
Complete Controller Example
๐งช Comprehensive Testing
The package includes built-in comprehensive testing functionality to validate all logging features:
Quick Test
Comprehensive Test
The comprehensive test covers:
- All Log Levels: info, warning, error, debug, success, critical, alert, emergency
- Complex Data Structures: Nested objects, arrays, mixed data types
- Data Type Permutations: All possible combinations of strings, numbers, booleans, arrays, objects, nulls
- Real-World Scenarios: E-commerce, monitoring, security, API responses
- Edge Cases: Special characters, unicode, boundary values, empty data
- Nested Function Calls: Call depth tracking and stack management
- Performance Metrics: Memory usage, execution time, database queries
Clean Test Logs
Test Features Demonstrated
The comprehensive test generates 26+ log entries covering:
Log Levels & Categories
- Information, Warning, Error, Debug, Success, Critical, Alert, Emergency
- Authentication, Database, API, Security, Performance, Data Test
Complex Data Structures
- User profiles with nested personal info, preferences, and activity
- System metrics with performance, database, and cache data
- Business logic with orders, inventory, and revenue tracking
- API responses with external and internal service monitoring
- Error tracking with recent errors and error rates
- Security events with failed logins and suspicious activity
Data Type Permutations
- Mixed arrays with strings, integers, floats, booleans, nulls
- Nested objects up to 4 levels deep
- Complex combinations of arrays and objects
- Edge cases with special characters, unicode, and boundary values
Real-World Examples
- E-commerce order processing with payment and inventory
- System monitoring with performance metrics and health checks
- Security monitoring with failed logins and threat detection
- API integration with external services and response tracking
View Test Results
After running tests, view the results in the web interface:
The test logs will be grouped by request ID, showing the complete flow of the comprehensive test with all data structures, log levels, and nested function calls.
Unit Testing
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
The MIT License (MIT). Please see License File for more information.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
- Farid
- All Contributors
Support
If you discover any issues, please open an issue on GitHub.
All versions of laravel-simple-logging with dependencies
illuminate/support Version ^9.0|^10.0|^11.0|^12.0
illuminate/database Version ^9.0|^10.0|^11.0|^12.0
illuminate/http Version ^9.0|^10.0|^11.0|^12.0
illuminate/view Version ^9.0|^10.0|^11.0|^12.0
illuminate/routing Version ^9.0|^10.0|^11.0|^12.0