承接 endritvs/user-logs 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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.

Latest Version on Packagist

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

  1. Get the Package

    Install via Composer:

    composer require endritvs/user-logs:^dev-main
  2. Configure Middleware

    Register the middleware in your application. First, add it to the $routeMiddleware property of your app/Http/Kernel.php file:

    protected $routeMiddleware = [
        // ... other middleware ...
        'track.user.log' => \Endritvs\UserLogs\Middleware\TrackUserLogMiddleware::class,
    ];

    Now, you can use the track.user.log middleware 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 ...
    });
  3. Configure Logging Channel

    Register the custom logging channel in config/logging.php:

    'user_logs' => [
        'driver' => 'custom',
        'via' => Endritvs\UserLogs\TrackUserLog::class,
    ]
  4. 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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-09-28