承接 avengers-code-lovers/laravel-log-monitoring 相关项目开发

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

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

avengers-code-lovers/laravel-log-monitoring

最新稳定版本:1.3.0

Composer 安装命令:

composer require avengers-code-lovers/laravel-log-monitoring

包简介

Laravel log monitoring with log Laravel and log queue from avengers code lovers

README 文档

README

To get started with Monitoring Log Laravel, use Composer to add the package to your project's dependencies:

   composer require avengers-code-lovers/laravel-log-monitoring

Configuration

Laravel 5.5+

Laravel uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.

Laravel < 5.5:

If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php

'providers' => [
    // Other service providers...

    AvengersGroup\MonitoringServiceProvider::class

],

Set your session start to global middleware in app/Http/Kernel.php

protected $middleware => [
    // Other global middleware...

    \Illuminate\Session\Middleware\StartSession::class,
];

protected $middlewareGroups => [
    'web' => [
        \App\Http\Middleware\EncryptCookies::class,
        \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
        //\Illuminate\Session\Middleware\StartSession::class,       // Comment this
        // ...
    ],
];

You will also need to add api_key chatwork bot and room sos for services your application utilizes. These credentials should be placed in your config/services.php configuration file, and use the key chatwork. For example:

    'chatwork' => [
        'api_key' => env('CHATWORK_API_KEY'),
        'room_id_sos' => env('CHATWORK_API_ROOM_ID'),
        'role' => [
            'admin' => 'admin'
        ]
    ]

Add key in .env

CHATWORK_API_KEY=xxxxx
CHATWORK_API_ROOM_ID=xxxxx

Basic Usage Monitoring Log Laravel Application Error

Add Monitoring Log Laravel reporting to App/Exceptions/Handler.php:

public function report(Exception $exception)
{
    app('monitoring')->sendExceptionToChatWork($exception);

    parent::report($exception);
}

Basic Usage Monitoring Log Queue Error

Follow document in https://laravel.com/docs/master/queues#cleaning-up-after-failed-jobs

/**
 * The job failed to process.
 *
 * @param  Exception  $exception
 * @return void
 */
public function failed(Exception $exception)
{
    app('monitoring')->sendExceptionToChatWork($exception);
}

Advance Usage

Monitoring Log Laravel support reporting accept $request as param with supportable functions which come with a message with more infomation

Add Monitoring Log Laravel reporting to App/Exceptions/Handler.php:

/**
 * Render an exception into an HTTP response.
 *
 * @param  \Illuminate\Http\Request  $request
 * @param  \Exception  $exception
 * @return \Illuminate\Http\Response
 */
public function render($request, Exception $exception)
{
    app('monitoring')->sendExceptionToChatWork($exception, $request);

    return parent::render($request, $exception);
}

统计信息

  • 总下载量: 5.99k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 9
  • Watchers: 0
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2020-02-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固