The log was empty. It wasn’t supposed to be.
You were sure the query ran. You were sure the service pushed the event. But there it was — nothing. Blank lines staring back like a taunt. When you work with services behind a proxy, or debug databases with tools like pgcli, you live and die by what the logs tell you. Without direct visibility, you’re guessing instead of knowing.
Logs access through a proxy isn’t hard, but it is often done wrong. Too many setups funnel application and database logs into black holes of complexity. You want a clear, immediate view, not another layer that hides reality. That’s why understanding the flow between your proxy, your database, and tools like pgcli is not optional. It’s your shortest path from “I think” to “I know.”
When pgcli runs against a PostgreSQL instance behind a proxy, the network between you and the logs is made of hops you do not see. Your query hits the proxy. The proxy connects to the database. The actual execution happens there. Logs may never surface unless you configure the path. Standard logs can be captured either at the proxy level, the database itself, or both. The right choice depends on how much detail you need and how fast you need it.
Here’s the disciplined way to set it up:
- Enable structured logging at the database layer, making sure each query is timestamped and tied to a session ID.
- Configure your proxy to emit its own connection and query flow logs, ideally in a format that matches your database logs for easy correlation.
- Make both streams available in real time — streaming to stdout, a log aggregation service, or directly into your terminal.
- Use pgcli’s connection settings to force SSL or tunnel paths that keep the chain secure without slowing access.
Once logs are flowing, you erase the guesswork. You can watch queries in pgcli and confirm their exact execution in the logs. You can trace delays to either the proxy hop or the database engine. You can measure query plans against reality, instead of speculation.
When the chain works, the feedback loop is instant. The next slow query fix happens in seconds, not in meetings. Performance stops being a debate and starts being a number you can point to.
This is why real-time logs access for proxy + pgcli setups is the difference between chasing ghosts and solving problems. You don’t need to accept latency in your visibility. You can see it, test it, and know it — right now.
You can spin up a real example, with logs flowing through a proxy to pgcli, without touching your production setup. Try it, see the logs appear as you query, and watch the whole chain in action. It takes minutes on hoop.dev.