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

Same template for both logging.yml and log4j2.properties #907

Open
maxenced opened this issue Dec 13, 2017 · 4 comments · May be fixed by #1234
Open

Same template for both logging.yml and log4j2.properties #907

maxenced opened this issue Dec 13, 2017 · 4 comments · May be fixed by #1234

Comments

@maxenced
Copy link
Contributor

Hi,

https://github.com/elastic/puppet-elasticsearch/blob/6d31554205305d4127acb8d31f4e640466c42f70/manifests/instance.pp#L244
https://github.com/elastic/puppet-elasticsearch/blob/6d31554205305d4127acb8d31f4e640466c42f70/manifests/instance.pp#L245

Is there any reason that only one template is allowed for both logging.yml and log4j2.properties ? When using default values, there are 2 templates (which is correct), but if you override the logging_template variable, it will replace both files, while one is YML, the other is ini like, and both have totally different content.

@tylerjl
Copy link
Contributor

tylerjl commented Dec 13, 2017

There's not an outstanding reason I can think of that they need to be that way, there should probably be a parameter to determine which logging file to use. logging.yml is still around in the module since 2.x isn't officially EOL yet, but I think the reasonable approach would be to keep generically-named parameters like logging_template but use parameters like logging_yml_ensure and log4j2_ensure and default to absent and file respectively to default to 5.x/6.x behavior.

@smetj
Copy link

smetj commented Apr 9, 2018

Hi,

There seems to be something going on with this.
Let's say you wish to override a value in logging.yaml:

logging_template  => "${module_name}/elasticsearch/logging.yml.erb",
log4j2_ensure     => absent,

You're obliged to set log4j2 to absent otherwise you end up with log4j2.properties and logging.yml to be identical which leads not elasticsearch not starting.
The error message you get when restarting Elasticsearch is a bit of a "head scratcher" and not something fun to run into in a production environment.

@smetj
Copy link

smetj commented Apr 9, 2018

It seems the correct combination of options is:

logging_template   => "${module_name}/elasticsearch/logging.yml.erb",
logging_yml_ensure => absent,

@sergii-zemlianyi
Copy link

I don't see logging_yml_ensure param to be availble anywhere in module
How can control log4j content while not manage logging.yml ?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment