petershaw/told-client 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

petershaw/told-client

Composer 安装命令:

composer require petershaw/told-client

包简介

A client to log messages to the told server.

README 文档

README

Build Status Latest Stable Version

A client to log messates into a told log recorder. See https://github.com/petershaw/told-LogRecorder to lern more about told.

Description

Sends a message to the server. Noting more, nothing less.

Installation

###Composer ### The easiest way is to use Composer. Add

    "require": {
        petershaw/told-client
    }

to your composer.json file and run composer install on your project.

Downlaod

As an alternative to composer, it is possible to download the latest and greatest version of ToldClient.php from github. and require it from within your script.

require('/path/to/your/downloaded//libs/ToldClient.php');

Usage

###Configuration### First of all you have to initiate the Client with a few minimal configurations. It is up to you how you set them. It is possible to pass an config array to the init method of the client, or to initiate the client blank and set the config-params later on.

Example 1:

	$conf = Array();
	$conf['host'] = "test://told.my-domain.com";
	$conf['type'] = "Application Name";
	$told = new ToldClient($config);

Example 2:

     $told = new ToldClient();
     $told->setHost("test://told.my-domain.com");
     $told->setType("Application Name");

The 'host' parameter is mandatory.! Optional parameters are: type, tags, defaulttage and debug.

tag Description
type Describes the type of this log message. Choose the type wisely, because you will group by type at the administration frontend.
tags These tags will be send ALWAYS right next to the tags that are send by the call it self. It is a good decision to add your application-id and maybe customer-id as tags.
defaultags To set some default tags that will be overwritten by the call . If no tags are given, than the defaulttags take place.

Send

After initialisation the client is ready to use. To send a message with the default tags and type, just call

$told->tell("This is my little test message");

Each call can have special types and tags. For example: to send a message with a type of 'Testing' and the Tag 'Honigkuchen' call

$told->tell("This is my little test message", "Testing", "Honigkuchen");

Or to send multiple tags, like Honigkuchen and Zuckerschlecken it is possible to pass a array:

$told->tell("This is my little test message", "Testing", Array("Honigkuchen", "Zuckerschlecken"));

Protokoll

As default, this client use http POST over tcp ip.

Limitations

The current Told-LogRecorder supports structured messages in schema less format. This feature is not supported by this client, yet.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2013-10-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固