Skip to content

Allow custom log_levels#156

Closed
zoidyzoidzoid wants to merge 1 commit into
docker-library:masterfrom
zoidyzoidzoid:master
Closed

Allow custom log_levels#156
zoidyzoidzoid wants to merge 1 commit into
docker-library:masterfrom
zoidyzoidzoid:master

Conversation

@zoidyzoidzoid

Copy link
Copy Markdown

Closes #118

@zoidyzoidzoid

Copy link
Copy Markdown
Author

Tested with:

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

@tianon

tianon commented May 31, 2017

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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

michaelklishin commented May 31, 2017

Copy link
Copy Markdown
Collaborator

@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

tianon commented May 31, 2017

Copy link
Copy Markdown
Member

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
Copy Markdown
Collaborator

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

@zoidyzoidzoid

Copy link
Copy Markdown
Author

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

😋

@ilude

ilude commented Sep 12, 2017

Copy link
Copy Markdown

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