Download the PHP package cmever/log without Composer

On this page you can find all versions of the php package cmever/log. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package log

Cmever Log

用于内部服务记录日志,统一收口方便管理

安装方法

使用 composer 包管理工具,安装包管理工具请参考 http://www.phpcomposer.com/,安装好之后,在项目根路径下(含 composer.json ),执行如下指令进行安装

快速上手

在安装好依赖包之后,通过如下三个步骤步即可向 ES 发送 Log

第一步:引入 composer 自动加载

如果没有使用基于composer的框架,则需要自行引入 autoload.php 文件

第二步:全局配置

第三步:记录日志

完整代码

demos

提供的内置demo,可在对应文件夹找到并在命令行执行测试,比如:

文件 作用
demos/simple_es_log.php ES Log 的简单调用

Log内置方法

debug/info/warning/error/fatal

方法类型

成员方法

作用

用于记录不同等级的日志,在对应字段中有所表现

参数
参数名称 是否必填 默认值 作用
event "" 事件名称,可用于标记事件类型或访问路由
message "" 日志内容
extraData [] 自定义数据,根据具体业务场景而定
使用样例

setGlobalConfig

方法类型

静态方法

作用

覆盖全局默认配置,详细配置参数见后文

使用样例

setConfig

方法类型

成员方法

作用

覆盖实例配置,详细配置参数见后文

使用样例

ESLog可配置参数

参数名称 必填 默认值 作用
log_url 日志服务器可访问路径,如 https://xxx.xxx/
server_name none 区分不同应用
env APP_ENV 区分测试/正式环境
client_ip $_SERVER['REMOTE_ADDR'] 客户端IP
server_ip $_SERVER['SERVER_ADDR'] 服务器IP,用于区分同一个服务的多个服务器,便于调试及关联日志查找
timeout 3 请求超时时间,最小设为 0.1

All versions of log with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
ext-json Version *
ext-curl Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package cmever/log contains the following files

Loading the files please wait ....