chore(gastown): remove manual request logging middleware#3158
Open
jrf0110 wants to merge 1 commit intogastown-stagingfrom
Open
chore(gastown): remove manual request logging middleware#3158jrf0110 wants to merge 1 commit intogastown-stagingfrom
jrf0110 wants to merge 1 commit intogastown-stagingfrom
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge This is a clean deletion of redundant request-logging middleware. The removed code:
Files Reviewed (1 file)
Fix these issues in Kilo Cloud Reviewed by claude-sonnet-4.6 · 220,254 tokens |
jrf0110
commented
May 10, 2026
Comment on lines
-193
to
-198
| logger.setTags({ | ||
| orgId: RE_ORG.exec(path)?.groups?.orgId, | ||
| townId: RE_TOWN.exec(path)?.groups?.townId, | ||
| rigId: RE_RIG.exec(path)?.groups?.rigId, | ||
| agentId: RE_AGENT.exec(path)?.groups?.agentId, | ||
| }); |
Contributor
Author
There was a problem hiding this comment.
It'd still be nice to set tags on requests, but maybe we can do it in a way more structured way like:
app.use('/api/towns/:townId', async (c, next) => {
logger.setTags({ townId: c.req.param('townId' })
await next()
})
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes the redundant request-logging middleware from
gastown.worker.tsthat logged every HTTP request twice (incoming + outgoing) vialogger.info(). This is already covered by the per-routeinstrumented(c, route, handler)wrapper fromanalytics.middleware.tswhich emits structured AE events withroute,userId,townId,rigId,agentId,beadId,durationMs, anderrorfor every wrapped route.Two pieces removed:
import { logger } from './util/log.util'line (now unused at the worker level)app.use('*', ...)withlogger.setTags,logger.infocalls)Preserved:
timingMiddlewareanduseWorkersLoggermiddleware — these are independent infrastructure that other code depends on.Verification
Manual review of the diff confirms 30 lines deleted, 0 added, single file modified.
Visual Changes
N/A
Reviewer Notes
The
logger.setTagscall from URL regexes is safe to remove — those tags were only consumed by the twologger.infolines being removed. Auth middleware already setsorgId/userIdtags via JWT-derived values. Town.do.ts runs in a separate isolate and does its ownsetTags.