定制 trinity/logger 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

trinity/logger

Composer 安装命令:

composer require trinity/logger

包简介

Trinity Logger bundle

README 文档

README

This bundle is reconstructed for new elasticsearch (v5) and the read me is not actualized yet. TODO

Coverage Status Build Status

Bundle for storing and loading logs in ElasticSearch database.

Write issue if you found something that doesn't work as it should.

Logger creates new index each day in format YYYY-MM-DD. It works with environment and as for now two types are used. Development and Production logs are written into same index. The test environment adds prefix 'test-' before the index.

Thanks to this the logs may be viewed directly by using URL:

http:\\elastic_host:port\YYYY-MM-DD\LogName\LogId

for example:

trinity_logger:
  elastic_logs:
    elastic_host: '127.0.0.1:9200'
    managed_index: 'necktie'

Configured index can be changed when method is called.

Classic call:

$this->get('trinity.elastic.read.log.service')->getCount('ExceptionLog');

Call different index:

$this->get('trinity.elastic.read.log.service')->setIndex('venice')->getCount('ExceptionLog');

For searching it is required to know where is entity class stored. Most classes are stored on same place and therefor they can be added into configuration as follow:

trinity_logger:
  elastic_logs:
    elastic_host: '127.0.0.1:9200'
    managed_index: 'necktie'
    entities_path: 'Necktie\\AppBundle\\Entity'

When we use nqlQuery (see trinity/search for more about used nqlQuery) we can call:

$entities = $this->get('trinity.elastic.read.log.service')->getByQuery($nqlQuery);

If entity definition is stored elsewhere, we go for example as this:

$entities = $this->get('trinity.elastic.read.log.service')
    ->setEntityPath('Necktie\\PaymentBundle\\Entity')
    ->getByQuery($nqlQuery);

Note: ElasticSearch is noSQL database.... NO!!!SQL therefor it will go with only queries under one entity. If you need join something use relation based SQL database.

As main use of this bundle for now is Necktie, following values are used as default and doesn't require configuration. managed_index: 'necktie' entities_path: 'Necktie\AppBundle\Entity'

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-02-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固