SDK logger should use info level when a log item is added, rather than the log item's level

未关闭 适合新手
#2,431 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
php, symfony
领域
backend

调研方向

首先追踪 SDK 如何记录捕获的日志项,以及如何将该项的级别传递给 Symfony ConsoleLogger。Issue 给出了复现步骤和预期的控制台输出,但没有指出文件或测试;先定位相关的日志代码和测试。完成标准是:捕获的日志项以 info 级别记录,并在适当时将该项的级别保留在消息中。

由索引模型根据 Issue 内容生成。

描述

Bug PHP
How do you use Sentry?

Sentry SaaS (sentry.io)

SDK version

5.x-dev

Steps to reproduce

Attach Symfony ConsoleLogger to the Sentry SDK. In a console command, capture a log item ("Test log message") with "warn" or "error" as the log level.

Expected result

Assuming the SDK is working as intended, there is no warning or error condition to log when a log item is captured. The SDK should log to the console at "info" level: "[info] Logs item: Test log message". I would also suggest that the log item's level could be added here, such as: "[info] Logs item (warn): Test log message" or "[info] Logs item (error): Test log message"

Actual result

The SDK logs to the console at "warning" or "error" level: "[warning] Logs item: Test log message" or "[error] Logs item: Test log message"

This is a bit confusing because although a warning or error item was logged, the SDK does not actually have a warning or error condition to report.

主要语言
PHP
星标
1.9k
派生
478
平均合并
14 小时 54 分钟
30 天内合并 PR
111

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

getsentry/sentry-php 的其他 Issue

查看 getsentry/sentry-php 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。