承接 blueant-allan/elasticlogger 相关项目开发

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

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

blueant-allan/elasticlogger

最新稳定版本:1.0

Composer 安装命令:

composer require blueant-allan/elasticlogger

包简介

A CakePHP custom log plugin for Cloudstaff

README 文档

README

A CakePHP plugin for creating custom logs. Using CakePHP version 3.x

Installation

You can install this plugin into your CakePHP application using composer.

The recommended way to install composer packages is:

composer require blueant-allan/ElasticLogger

Configuration

  1. After installing the package in your project. You need to load the plugin, in your src/Application.php inside your bootstrap method add the following code to load the plugin.
public function bootstrap()
{
    // you loaded plugins here

    $this->addPlugin('ElasticLogger');
}
  1. To start using the plugin, load the component in your controller initialize() method as such:
public function initialize(): void
{
    parent::initialize();

    // more of your controller initialize code here


    $this->loadComponent('ElasticLogger.Logcentral');
}

Usage

The component will expect the following parameters:

  • EventType Can be use to describe the type of event being written to logs
  • Message content message of your logs
  • (Optional) this third parameter is optional. In case you need to pass a object or array, you may use this third parameter to add that object or array to your logs

Create an activity information log:

$this->Logcentral->activityInfo('EventType', 'your message');

Create an activity debug log:

$this->Logcentral->activityDebug('EventType', 'your message');

Create an activity Error log:

$this->Logcentral->activityError('EventType', 'your message');

Create an activity Notice log:

$this->Logcentral->activityNotice('EventType', 'your message');

Create an activity Warning log:

$this->Logcentral->activityWarning('EventType', 'your message');

Pass an array to your logs. Example below:

$data = [
    'id' => 42,
    'name' => 'Mark Tune',
    'roles' => ['Admin', 'Support']
];

$this->Logcentral->activityInfo('Login', 'User successfully logged in', $data);

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固