• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

maruina / go-infrabin / 18804481427 / 1
56%
master: 56%

Build:
DEFAULT BRANCH: master
Ran 25 Oct 2025 02:41PM UTC
Files 14
Run time 0s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

25 Oct 2025 02:39PM UTC coverage: 51.009% (-3.7%) from 54.714%
18804481427.1

push

github

web-flow
Enhance HTTP request logging with proxy-aware source IP tracking (#404)

* Enhance HTTP request logging with proxy-aware source IP tracking

Replaces standard Apache Combined Log Format with an enhanced version that properly handles proxy headers (X-Real-IP, X-Forwarded-For) for accurate source IP logging.

## Changes

- Add `pkg/infrabin/logging.go` with custom log formatter
  - `RequestLoggingFormatter`: Extends Apache Combined Log Format
  - `getSourceIP`: Extracts client IP from proxy headers
- Update `pkg/infrabin/http.go` to use custom logging handler
  - Replace `CombinedLoggingHandler` with `CustomLoggingHandler`
  - Apply custom formatter for enhanced logging

## Log Format

sourceIP - remoteUser [timestamp] "method path protocol" statusCode size "referer" "userAgent"

## Benefits

- Accurate client IP logging behind proxies/load balancers
- Full Apache Combined format compatibility
- All request metadata preserved (size, user-agent, referer, protocol)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix errcheck linter: explicitly ignore fmt.Fprintf error

The LogFormatter signature doesn't allow error returns, and logging
failures shouldn't impact request handling. Following idiomatic Go
practice by explicitly acknowledging the ignored error with blank
identifiers.

---------

Co-authored-by: Claude <noreply@anthropic.com>

354 of 694 relevant lines covered (51.01%)

3.19 hits per line

Source Files on job 18804481427.1
  • Tree
  • List 14
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 18804481427
  • 79b3f077 on github
  • Prev Job for on master (#18802780471.1)
  • Next Job for on master (#18807559949.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc