elementary/gelf-php
Composer 安装命令:
composer require elementary/gelf-php
包简介
A php implementation to send log-messages to a GELF compatible backend like Graylog2.
README 文档
README
A php implementation to send log-files to a gelf compatible backend like Graylog2. This library conforms to the PSR standards in regards to structure (4), coding-style (1, 2) and logging (3).
It's a loosely based on the original Graylog2 gelf-php and mlehner's fork.
Stable release and deprecation of the original graylog2/gelf-php
This implementation became the official PHP GELF library on 2013-12-19 and is now released as graylog2/gelf-php.
The old library became deprecated at the same time and it's recommended to upgrade.
Since the deprecated library never got a stable release, we decided keep it available as v0.1. This means:
If you have a project based on the deprecated library but no time to upgrade to version 1.0, we recommend to change your
composer.json as following:
"require": {
// ...
"graylog2/gelf-php": "0.1.*"
// ...
}
After running an additional composer update everything should work as expected.
Usage
Recommended installation via composer:
Add gelf-php to composer.json either by running composer require graylog2/gelf-php or by defining it manually:
"require": {
// ...
"graylog2/gelf-php": "~1.5"
// ...
}
Reinstall dependencies: composer install
Examples
For usage examples, go to /examples.
HHVM
While HHVM is supported/tested, there are some restrictions to look out for:
- Stream-context support is very limited (as of 2014) - especially regarding SSL - many use-cases might not work as expected (or not at all...)
fwritedoes behave a little different
The failing unit-tests are skipped by default when running on HHVM. They are also all annotated with @group hhvm-failures.
You can force to run those failures by setting FORCE_HHVM_TESTS=1 in the environment. Therefore you can specifically check
the state of HHVM failures by running:
FORCE_HHVM_TESTS=1 hhvm vendor/bin/phpunit --group hhvm-failures
License
The library is licensed under the MIT license. For details check out the LICENSE file.
Development & Contributing
You are welcome to modify, extend and bugfix all you like. :-) If you have any questions/proposals/etc. you can contact me on Twitter (@bzikarsky) or message me on freenode#graylog2.
Tools
- composer, preferably a system-wide installation as
composer - PHPUnit
- Optional: PHP_CodeSniffer for PSR-X-compatibility checks
Steps
- Clone repository and cd into it:
git clone git@github.com:bzikarsky/gelf-php && cd gelf-php - Install dependencies:
composer install - Run unit-tests:
vendor/bin/phpunit - Check PSR compatibility:
vendor/bin/phpcs --standard=PSR2 src tests examples
elementary/gelf-php 适用场景与选型建议
elementary/gelf-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 44 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 05 月 29 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 elementary/gelf-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 elementary/gelf-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 44
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 5
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-05-29