koajs / koajs/logger

Is there a reason not to pass ctx on Custom Transporter?

Open
#77 1 comment 11 reactions 0 assignees Claimed by @roark View on GitHub
Dominant language
JavaScript
Stars
560
Forks
98
PR merge metrics
No merged PRs in 30d

Description

i want add request log
```ts
app.use(logger((ctx, str, args) => {
console.log(str, ctx.request.ip); // ctx.request.header['user-agent'], etc...
}))
```

Contributor guide

Open the contributing guide

Research direction

Review the custom transporter entry point and the open pull request #83 first. Determine how the logger callback currently receives its arguments and whether request context can be exposed there. Done means the proposed callback can access ctx for request logging, with the existing logger behavior preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.