Skip to content

feat(platform-api): include user-agent in access logs - #3277

Open
renuka-fernando wants to merge 1 commit into
wso2:platform-api/v0.10.xfrom
renuka-fernando:platform-api/v0.10.x
Open

feat(platform-api): include user-agent in access logs#3277
renuka-fernando wants to merge 1 commit into
wso2:platform-api/v0.10.xfrom
renuka-fernando:platform-api/v0.10.x

Conversation

@renuka-fernando

Copy link
Copy Markdown
Contributor

Purpose

The platform-api access log is produced by gin's built-in logger, whose format is fixed and does not capture the client User-Agent, making it hard to identify which clients are calling the API.
This PR extends the access log to include the request User-Agent.

Approach

  • Replace gin.Default() with gin.New() plus explicit logger and recovery middleware so the access-log format can be customized.
  • Add a custom log formatter that mirrors gin's default access-log format and appends the request User-Agent.

Related Issues

N/A

Checklist

  • Tests added or updated (unit, integration, etc.)
  • Samples updated (if applicable)

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@renuka-fernando, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 4 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ae93e23a-ae82-4782-8c73-0fb9cf2278b2

📥 Commits

Reviewing files that changed from the base of the PR and between df05605 and 049aeff.

📒 Files selected for processing (1)
  • platform-api/src/internal/server/server.go

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Replace gin.Default() with gin.New() plus explicit logger and
recovery middleware so the access log can be customized. Add a
custom formatter that mirrors gin's default format and appends
the request User-Agent for client identification.

Signed-off-by: Renuka Fernando <renukapiyumal@gmail.com>
@renuka-fernando

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants