承接 sinarajabpour1998/log-manager 相关项目开发

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

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

sinarajabpour1998/log-manager

Composer 安装命令:

composer require sinarajabpour1998/log-manager

包简介

This package provides log manager in laravel apps.

README 文档

README

This package provides log manager for laravel apps.

Installation

Using Composer :

composer require sinarajabpour1998/log-manager

packagist : log-manager

Usage

  • Publish blade files
php artisan vendor:publish --tag=log-manager

** Please note if you already published the vendor, for updates you can run the following command :

php artisan vendor:publish --tag=log-manager --force
  • Run migration command :
php artisan migrate
  • Add the following tag in your sidebar layout :
<x-log-menu></x-log-menu>

or shorten tag :

<x-log-menu />

Save custom logs

  • First define some log types in log-manager config :

Types structure: "type" => "type_name"

[
"log_types" => [
        "login" => "ورود به سایت",
        "registration" => "ثبت نام در سایت"
    ]
];
  • Add the following code anywhere you want (be careful about namespace)
use Sinarajabpour1998\LogManager\Facades\LogFacade;

LogFacade::generateLog("login");

Done ! now all the logs will be saved in the logs table

Save system error logs

Edit the following file :

app\Exceptions\Handler.php

Your register method in Exception handler must be like this :

    use Sinarajabpour1998\LogManager\Facades\LogFacade;
    /**
     * Register the exception handling callbacks for the application.
     *
     * @return void
     */
    public function register()
    {
        $this->reportable(function (Throwable $e) {
            // Added for log-manager
            if ($this->shouldReport($e)){
                LogFacade::generateErrorLog($e);
            }
        });
    }

Done ! now all the system error logs will be saved in the error_logs table

Config options

You can set custom permissions for each section of this package. make sure that you already specified permissions in a seeder.

Also you need log_types before get started with custom logs.

统计信息

  • 总下载量: 61
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-11-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固