-
Notifications
You must be signed in to change notification settings - Fork 3.9k
RABBITMQ_LOGS=- prevents logging to other sources altogether #4303
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
Comments
Those who use |
@michaelklishin unfortunately the env vars take precedence. |
Environment variables in general are meant to override any configuration files to allow one to quickly run RabbitMQ with a different setting without touching those configuration files. So yes, setting
In particular, To enable the exchange logging output, you should be able to set Update: I fixed the line above: it was |
To me, the following is a bug in the docker image:
|
How does It sounds like we need to change how the Docker image configures logging. I'll open a related issue in that repo. |
Sorry, I meant |
My point is that environment variables should never be used for what can be configured in So I agree that an unconditional |
RabbitMQ now supports several configuration files. On Unix, it will load all files found in It should be easy for people packaging RabbitMQ to write their default values in |
I like it @dumbbell. I'll open an issue and PR for the docker image, and will get to documenting these vars a bit better on the website. Have a great weekend! |
Hello, Looks like omitting Best, Jeremy |
log.file.formatter = json |
So apparently there are both |
Thanks! Adding |
such as those used by JSON logging. References rabbitmq/rabbitmq-server#4303
https://groups.google.com/g/rabbitmq-users/c/j1AY7lBWI6c/m/kUMOb5wnAwAJ
When you run RabbitMQ from an official docker image, the following env variable is set:
This is what prevents the logging exchange from starting, even though that exchange is defined in the configuration file. I can reproduce the behavior outside of Docker if I run RabbitMQ like this:
As a workaround, you can build an image with a custom entrypoint that unsets the
RABBITMQ_LOGS
env variable. I have updated this repo with just that workaround and it DOES fix the issue:https://github.com/lukebakken/rabbitmq-users-j1AY7lBWI6c/blob/main/Dockerfile
After reading the source code, it looks like setting the
RABBITMQ_LOG
env var may be a better solution for Docker, but I can't seem to figure out the right syntax to enable both the console log and exchange log.https://github.com/rabbitmq/rabbitmq-server/blob/master/deps/rabbit/src/rabbit_prelaunch_logging.erl#L1094
The above suggests the following should work:
But it does not enable the exchange logger. In addition, I don't see how the parsing could work since commas are used to delineate per-logger configuration as well as the overall loggers themselves. This form makes more sense:
@dumbbell we should discuss.
The text was updated successfully, but these errors were encountered: