Skip to content

Allow custom log_levels #156

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

Closed
wants to merge 1 commit into from
Closed

Allow custom log_levels #156

wants to merge 1 commit into from

Conversation

zoidyzoidzoid
Copy link

Closes #118

@zoidyzoidzoid
Copy link
Author

Tested with:

docker run -it --rm -e RABBITMQ_LOG_LEVELS='[{connection, error}]' $IMAGE_ID

@tianon
Copy link
Member

tianon commented May 31, 2017

So far we've avoided exposing the user to any raw Erlang configuration in any of our environment variables, and especially considering that the 3.7 version of RabbitMQ is moving to a configuration file that's INI-based, I'd like to continue sticking to that.

@michaelklishin
Copy link
Collaborator

@tianon the Erlang term config format isn't going away, in fact, some things have such as complex structure that I don't think they can be moved to the .ini-style format. In 3.7.0 it will be a separate config file, though, and most things will use the .ini one. JFYI.

@michaelklishin
Copy link
Collaborator

Config settings can be passed on the command line, e.g.

RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS="-rabbit log_levels [{connection,error}]" rabbitmq-server

which is an Erlang/OTP feature: -rabbit key value on the command line is the same as setting rabbit.key to value in the Erlang term config file.

@michaelklishin
Copy link
Collaborator

michaelklishin commented May 31, 2017

@tianon in this particular case, the value of log_levels seems to be treated (passed on) as a string, so you don't necessarily run much risk in whitelisting it.

More complicated cases (e.g. LDAP queries) should be configured by providing a file IMO.

@tianon
Copy link
Member

tianon commented May 31, 2017

Ooooh, we should definitely document RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS -- that way we could stop doing so many of these one-off environment variables! 😄 Does that mean -rabbit could be specified more than once?

ala, RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS="-rabbit log_levels [{connection,error}] -rabbit something <<'somevalue'>>" ?

Good to know regarding the ini-style config -- will keep that in mind. 😅

@michaelklishin
Copy link
Collaborator

@tianon no, it would be -rabbit key1 value1 key2 value 2. See section 8.8 in this Erlang guide.

@zoidyzoidzoid
Copy link
Author

I guess that makes this PR related to this one as well: #138

😋

@ilude
Copy link

ilude commented Sep 12, 2017

See Pull request #187

Sorry, I did not intent to reopen this. Only to add a reference so other googlers could find a solution.

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

Successfully merging this pull request may close these issues.

4 participants