Skip to content

[WIP] Fix bytesSent tag not working in logging middleware#4227

Closed
gaby with Claude wants to merge 2 commits into
mainfrom
claude/fix-bytes-sent-tag-logging
Closed

[WIP] Fix bytesSent tag not working in logging middleware#4227
gaby with Claude wants to merge 2 commits into
mainfrom
claude/fix-bytes-sent-tag-logging

Conversation

@Claude

@Claude Claude AI commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.


This section details on the original issue you should resolve

<issue_title>🐛 [Bug]: bytesSent tag not working in logging middleware.</issue_title>
<issue_description>### Bug Description

bytesSent tag is always 0

How to Reproduce

Run demo code

output:

/test====0====

Expected Behavior

bytesSent tag has an actual value

Fiber Version

v3.1.0

Code Snippet (optional)

package main

import (
  "github.com/gofiber/fiber/v3"
  "github.com/gofiber/fiber/v3/middleware/logger"
)

func main() {
  app := fiber.New()

  app.Use(logger.New(logger.Config{
      Format: "${url}====${bytesSent}====\n",
  }))

  app.Get("/test", func(c fiber.Ctx) error {
      return c.SendString("test")
  })

  log.Fatal(app.Listen(":3000"))
}

Checklist:

  • I agree to follow Fiber's Code of Conduct.
  • I have checked for existing issues that describe my problem prior to opening this one.
  • I understand that improperly formatted bug reports may be closed without explanation.</issue_description>

Comments on the Issue (you are @claude[agent] in this section)

@Claude Claude AI assigned Claude and gaby Apr 22, 2026
@Claude Claude AI linked an issue Apr 22, 2026 that may be closed by this pull request
3 tasks
@ReneWerner87 ReneWerner87 added this to v3 Apr 22, 2026
@ReneWerner87 ReneWerner87 added this to the v3 milestone Apr 22, 2026
@Claude
Claude AI requested a review from gaby April 22, 2026 11:11
@codecov

codecov Bot commented Apr 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.86%. Comparing base (9fd194f) to head (f0bd9d9).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4227      +/-   ##
==========================================
- Coverage   91.24%   90.86%   -0.38%     
==========================================
  Files         123      123              
  Lines       11910    15227    +3317     
==========================================
+ Hits        10867    13836    +2969     
- Misses        655     1001     +346     
- Partials      388      390       +2     
Flag Coverage Δ
unittests 90.86% <100.00%> (-0.38%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gaby gaby closed this Apr 22, 2026
@github-project-automation github-project-automation Bot moved this to Done in v3 Apr 22, 2026
@liaohongxing

Copy link
Copy Markdown
Contributor

@claude[agent] Please estimate the performance of len(c.Response().Body())

@gaby
gaby deleted the claude/fix-bytes-sent-tag-logging branch April 22, 2026 11:25
@gofiber gofiber locked as resolved and limited conversation to collaborators Apr 22, 2026
@ReneWerner87 ReneWerner87 modified the milestones: v3, v3.2.0 Apr 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

🐛 [Bug]: bytesSent tag not working in logging middleware.

4 participants