endritvs/user-logs
最新稳定版本:1.0.0
Composer 安装命令:
composer require endritvs/user-logs
包简介
Track user logs easily with this package, easy also to integrate into all Laravel projects.
README 文档
README
The endritvs/user-logs package offers a robust solution to effortlessly track and log user activities in any Laravel application. With a breezy setup, maintain logs of user interactions to gain valuable insights for debugging, monitoring, or auditing.
Features
- 🌟 Seamless Integration: Just plug, play, and track! Integrates smoothly with existing Laravel applications.
- 📂 Organized Logs: Logs neatly organized by individual user IDs, offering clear visibility into each user's actions.
- 🛠 Customizable: Adjust or extend default behaviors as per your unique requirements.
- 🚀 Performance Optimized: Designed with minimal overhead to ensure smooth application performance.
Installation
-
Get the Package
Install via Composer:
composer require endritvs/user-logs:^dev-main
-
Configure Middleware
Register the middleware in your application. First, add it to the
$routeMiddlewareproperty of yourapp/Http/Kernel.phpfile:protected $routeMiddleware = [ // ... other middleware ... 'track.user.log' => \Endritvs\UserLogs\Middleware\TrackUserLogMiddleware::class, ];
Now, you can use the
track.user.logmiddleware in your routes file to apply it to individual routes or groups of routes and it will log all routes that user has accessed:Route::middleware('track.user.log')->group(function () { // ... your routes ... });
-
Configure Logging Channel
Register the custom logging channel in
config/logging.php:'user_logs' => [ 'driver' => 'custom', 'via' => Endritvs\UserLogs\TrackUserLog::class, ]
-
More Usage if you need - Optional
You can use also Laravel's native logging system to log user activities for:
Log::channel('user_logs')->info('User performed a specific action.');
By default, logs are found in
storage/logs/user_logs. They're sorted by user ID and the respective controller action.
Contributing
We welcome contributions! If you spot a bug, have a feature suggestion, or can enhance the current functionalities, please send a pull request.
License
This package adheres to the MIT License. Check out the LICENSE file for more details.
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-09-28