You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds the source IP address to HTTP request logs by modifying the morgan
logging configuration in `api/app.ts`.
**Changes:**
- Replaced predefined morgan formats (`'tiny'` and `'dev'`) with custom
format strings that include `:remote-addr`
- The new format is: `:remote-addr :method :url :status
:res[content-length] - :response-time ms`
- Applied to both color and no-color logging modes consistently
**Benefits:**
- Request logs now show the client IP address, improving debugging and
monitoring capabilities
- Works correctly with the existing `TRUST_PROXY` configuration to
extract real client IPs from proxy headers (X-Forwarded-For, etc.)
- Maintains backward compatibility with existing log parsing tools
**Example log output:**
```
2025-09-03 11:57:57.362 INFO APP: ::1 GET /health 404 1345 - 5.948 ms
2025-09-03 11:58:44.893 INFO APP: 192.168.1.100 POST /api/settings 200 156 - 12.334 ms
```
The `:remote-addr` token automatically handles IPv4/IPv6 addresses and
respects Express.js trust proxy settings for proper IP extraction when
deployed behind reverse proxies or load balancers.
Fixes#4355.
<!-- START COPILOT CODING AGENT TIPS -->
---
✨ Let Copilot coding agent [set things up for
you](https://github.com/zwave-js/zwave-js-ui/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: robertsLando <11502495+robertsLando@users.noreply.github.com>
Co-authored-by: robertsLando <daniel.sorridi@gmail.com>
0 commit comments