-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Access log is pretty useless for vibe server behind a proxy #2749
Comments
I've since discovered that the log is kind of cool because you can customize it. But not really. In fact the part which does all the intelligence is a final function in the HTTPLogger interface. Why? I would like to fix the issue with the X-Forwarded-For (which I actually fixed by changing the format), plus add the user id who is logged in (specific to my application). I was resigned to fixing this using a pre-process step, but the advantage of using the builtin logger is that it has access to what happened in the response. Now, I'm thinking what we want is to reorganize this logger -- HTTPLogger should abstract not only the output of the string to the log file, but also the creation of the string. It would not be difficult to just add calls to the apache formatter in all the implementations. This allows hooking all parts of the logger given access to the request and the response. |
I absolutely agree, HTTPLogger should be changed into an Apart from that, I think the format string uses the Apache format (might also be Nginx, I don't remember), so it would make sense to take another look at that to see whether there are any extensions that would fit the bill here, while staying "standard" compatible. For the username part, we could probably allocate two unused letters and make the |
I think that would be enough for my purposes. But in general, if we are to abstract the actual logging function, it needs access to all the things that are used by the apache formatter. In the end, I just ended up not bothering with the log, because my vibe server is behind an apache proxy (which is already logging all this information). |
When I turned on the access log for my vibe server that lives behind a proxy, I get for example:
That 127.0.0.1 is the address of the Apache server that has forwarded the request.
The X-Forwarded-For header is properly set, but the access log ignores it.
It would be nice if there was a setting on the server to overwrite the IP address of the client peer with the IP address of the X-Forwarded-For inside the HTTPServerRequest object, so it seamlessly works without having to change code that looks at the peer address.
The text was updated successfully, but these errors were encountered: