Skip to content
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

Make /var/log/zulip/errors.log also available in docker logs zulip #451

Open
ZelphirKaltstahl opened this issue Jul 28, 2024 · 2 comments
Open

Comments

@ZelphirKaltstahl
Copy link

ZelphirKaltstahl commented Jul 28, 2024

I have a Zulip in docker setup using the docker compose file from this repository (with environment variables changed to what I need) and I run it behind a reverse proxy. That requires some configuration of Zulip, as stated in the so far excellent docs 👍 .

However, it seems I made some mistake configuring the IP address of the reverse proxy. The error log at /var/log/zulip/errors.log says:

zerver.middleware.ProxyMisconfigurationError: Reverse proxy misconfiguration: Incorrect reveing-the-zulip-application-behind-a-reverse-proxy
2024-07-28 08:41:35.656 ERR  [django.request] Internal Server Error: /
Traceback (most recent call last):
  File "/srv/zulip-venv-cache/bbd84a06bc651effedfe39cab337a1bf300cee02/zulip-py3-venv/lib/py    response = get_response(request)
  File "/srv/zulip-venv-cache/bbd84a06bc651effedfe39cab337a1bf300cee02/zulip-py3-venv/lib/py    response = middleware_method(
  File "/home/zulip/deployments/2024-05-09-18-59-10/zerver/middleware.py", line 666, in proc    raise ProxyMisconfigurationError(proxy_state_header)
zerver.middleware.ProxyMisconfigurationError: Reverse proxy misconfiguration: Incorrect reveing-the-zulip-application-behind-a-reverse-proxy

I am not sure yet why it is wrong, but that is not the point of this issue. The point of this issue is, that this error is not visible in docker logs zulip, which is quite confusing. The UI shows:

Internal server error

Your Zulip chat cannot be loaded because the server is experiencing technical difficulties. 

[...]

But one does not see any error in docker logs. That is quite counter common practices. I concluded, that maybe Zulip does not log to stdout and searched for "logging" in the docs. The docs are great and I found what I needed to know: https://zulip.readthedocs.io/en/9.0/subsystems/logging.html#backend-logging. There is lists the file that Zulip logged the error to.

I propose an improvement: Make the logging target an environment variable with a default, that is the file shown in the docs. Then in the zulip-docker setup set this environment variable to stdout.

@timabbott timabbott changed the title Error logging not visible on stdout Make /var/log/zulip/errors.log also available in docker logs zulip Sep 26, 2024
@timabbott
Copy link
Member

Thanks for the report, I've edited the title to make the feature request more clear without reading the whole description. I'm not sure what's best practice here.

@nexcode
Copy link

nexcode commented Oct 18, 2024

In large infrastructures, there are often mechanisms that automatically collect Docker logs, so they need to be written not to files inside the container, but to stdout (or at least make such a setting)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants