Skip to content

rabbit_prelaunch_logging: $RABBITMQ_LOGS doesn't override log level if it is set in the configuration file #2911

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

Merged

Conversation

dumbbell
Copy link
Collaborator

Here is an example of that use case:

  • The official Docker image sets RABBITMQ_LOGS=- in the environment
  • A user of that image adds a configuration file with:
    log.console.level = debug
    

The initial implementation, introduced in #2861, considered that if the output is overriden in the environment (through $RABBITMQ_LOGS), any output configuration in the configuration file is ignored.

The problem is that the output-specific configuration could also set the log level which is not changed by $RABBITMQ_LOGS. This patch fixes that by keeping the log level from the configuration (if it is set obviously) even if the output is overridden in the environment.

@dumbbell dumbbell requested review from mkuratczyk and ansd March 19, 2021 09:17
Copy link
Member

@ansd ansd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested that with this PR log.console.level = debug outputs debug logs on K8s.
Thanks @dumbbell!

@dumbbell dumbbell marked this pull request as ready for review March 19, 2021 11:19
... if it is set in the configuration file.

Here is an example of that use case:
* The official Docker image sets RABBITMQ_LOGS=- in the environment
* A user of that image adds a configuration file with:
      log.console.level = debug

The initial implementation, introduced in #2861,
considered that if the output is overriden in the environment (through
$RABBITMQ_LOGS), any output configuration in the configuration file is
ignored.

The problem is that the output-specific configuration could also set the
log level which is not changed by $RABBITMQ_LOGS. This patch fixes that
by keeping the log level from the configuration (if it is set obviously)
even if the output is overridden in the environment.
@dumbbell dumbbell force-pushed the RABBITMQ_LOGS-envvar-does-not-override-configured-log-level branch from 4c0d6b0 to 9fd2d68 Compare March 19, 2021 14:43
@dumbbell dumbbell merged commit 726b8be into master Mar 19, 2021
@dumbbell dumbbell deleted the RABBITMQ_LOGS-envvar-does-not-override-configured-log-level branch March 19, 2021 14:44
@dumbbell
Copy link
Collaborator Author

Thank you @ansd! Merged.

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.

2 participants