joppedc/logsnag-php-sdk 问题修复 & 功能扩展

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

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

joppedc/logsnag-php-sdk

最新稳定版本:v1.0.2

Composer 安装命令:

composer require joppedc/logsnag-php-sdk

包简介

An integration of the Logsnag API for PHP

README 文档

README

LogSnag

Realtime monitoring, for your entire business. A LogSnag PHP SDK.

Latest Stable Version Test License

Unofficial PHP SDK

Getting started

Install

To install the SDK you will need to be using Composer in your project. To install it please see the composer docs.

This is the "core" SDK, meaning that all the core logic and models are here. If you are happy with using your own HTTP client, install the SDK like: joppedc/logsnag-php-sdk

composer require joppedc/logsnag-php-sdk

This package (joppedc/logsnag-php-sdk) is not tied to any specific library that sends HTTP messages. Instead, it uses Httplug to let users choose whichever PSR-7 implementation and HTTP client they want to use.

If you just want to get started quickly you should run the following command:

composer require joppedc/logsnag-php-sdk php-http/curl-client

This will install the library itself along with an HTTP client adapter that uses cURL as transport method (provided by Httplug). You do not have to use those packages if you do not want to. The SDK does not care about which transport method you want to use because it's an implementation detail of your application.

Configuration

new JoppeDc\LogsnagPhpSdk\Client("your_secret_key");

Usage

Create new log event

$payload = new JoppeDc\LogsnagPhpSdk\Contracts\LogPayload(
    'project_name',
    'channel_name',
    'event_name'
);

$payload->setDescription('test-description');
$payload->setTags(['tag' => 'tag value']);
$payload->setIcon('😀');

$log = $this->client->createLog($payload);

Create new insight event

$payload = new JoppeDc\LogsnagPhpSdk\Contracts\InsightPayload(
    'project_name',
    'title',
    5
);

$payload->setIcon('😀');

$insight = $this->client->createInsight($payload);

Mutate an insight event

$payload = new JoppeDc\LogsnagPhpSdk\Contracts\MutateInsightPayload(
    'project_name',
    'title',
    -5
);

$payload->setIcon('😀');

$insight = $this->client->mutateInsight($payload);

Special thanks

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-04-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固