定制 utexas/utexas_pantheon_logs_http 二次开发

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

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

utexas/utexas_pantheon_logs_http

Composer 安装命令:

composer require utexas/utexas_pantheon_logs_http

包简介

Client for the UTexas Pantheon Logs HTTP API.

关键字:

README 文档

README

Provides JSON event pushing to Splunk Logs via the tag/http endpoint.

This module is based on the Logs HTTP contrib module, which wass designed as a generalized solution for pushing Watchdog logs to an HTTP endpoint such as Logstash, or paid services such as Loggly.

This custom fork adds needed functionality to allow Watchdog logs on a Pantheon-hosted site to be pushed to the UT Austin Splunk instance via a Splunk HTTP Event Collector (HEC).

The HTTP connection code has been modified to meet the requirements of Pantheon's Secure Integration platform feature, which allows the messages to be sent over an existing secure tunnel between Pantheon and the UT Austin network.

This module also allows the use of a secure token which is required for connection to the Splunk HEC. See (Splunk) HTTP Event Collector (HEC) for more information about HEC configuration.

The configuration that is provided, consists of variables which make the connection between Pantheon logs and Splunk, the variables are:

  • Endpoint: The Splunk URL which is "pinged" with the event Post request
  • Secure integration constant name: A Pantheon specific constant which holds a port that is required to build the URL (along with the endpoint) to connect into Splunk
  • Watchdog Severity: The watchdog severity level value, which is set to log anything between Info and Error (anything but debug messages)

There is one last variable needed, but no provided by default for the field: Splunk HTTP Event Collector Token.

Requirements

  • Drupal 9
  • Existing Pantheon Secure Integration configuration, configured with the IP address and port number of the UT Austin Splunk instance
  • Existing Splunk HTTP Event Collector, configured with allow-list of Pantheon IP addresses provided by the Secure Integration configuration.

How to use

After enabling the module, default config will be set at admin/config/services/logs-http-client.

The Splunk HTTP Event Collector Token, will need to be uploaded via SFTP (if not provisioned by Jenkins), which can be found in Stache as Splunk HEC Token PantheonAppLogs. The new file has to be named splunk_settings.json, has to be uploaded into /files/private/splunk, and has to have the following format:

{
	"splunk_settings":{
		"splunk_hec_token":"[the-token-value]"
	}
}

Once this is set, any subsequent watchdog logging shall send logs into Splunk. To verify that the site is logging data correctly, you can go to admin/config/services/logs-http-client and look for a message at the top stating if the Splunk Auth token was either found or not found. Or, access this Splunk link and replace the request_uri parameter with https://yourpantheonsite.pantheonsite.io/*. If you get a hit while searching results, the module has beeen configured correctly.

Debugging

Using the Logger class to print notices on your watchdog logs is the best way to debug this module's content.

utexas/utexas_pantheon_logs_http 适用场景与选型建议

utexas/utexas_pantheon_logs_http 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 156.5k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2021 年 09 月 24 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「drupal」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 utexas/utexas_pantheon_logs_http 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 utexas/utexas_pantheon_logs_http 我们能提供哪些服务?
定制开发 / 二次开发

基于 utexas/utexas_pantheon_logs_http 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2021-09-24