2017 © Pedro Peláez
 

library es-log

log to elasticsearch

image

hitman/es-log

log to elasticsearch

  • Tuesday, April 25, 2017
  • by hitmanv
  • Repository
  • 1 Watchers
  • 3 Stars
  • 355 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

eslog

日志记录工具, (*1)

安装

composer require hitman/eslog:dev-master

使用

Step1 config/app.php 添加

Hitman\Elasticsearch\EsLogServiceProvider::class,

// 添加Facade
'EsLog' => Hitman\Elasticsearch\Facade\EsLog::class,

Step2 生成配置文件 config/es.php

php artisan vendor:publish

Step3 修改配置

<?php
return [
    'hosts' => ['127.0.0.1'], // elasticsearch 地址
    'index' => 'log', // elasticsearch index
    'type' => 'test', // elasticsearch type
    'async' => true, // 是否使用队列异步上传日志
    'queue' => 'default', // 日志对应的队列
];


Step4 使用

// 使用DI
$eslog = resolve('eslog');
$eslog->error($data);
$eslog->info($data);
$eslog->event($event, $data);
$eslog->exception($exception);
$eslog->log($type, $data); // 自定义类型日志

## 使用Facade 
use EsLog;
EsLog::error($data);
EsLog::info($data);
EsLog::event($event, $data);
EsLog::exception($exception);
EsLog::log($type, $data); // 自定义类型日志

The Versions

25/04 2017

dev-master

9999999-dev

log to elasticsearch

  Sources   Download

The Requires

 

by hitman

25/04 2017

1.0.1

1.0.1.0

log to elasticsearch

  Sources   Download

The Requires

 

by hitman