question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use Elasticsearch's logging configuration

See original GitHub issue

Historically Rally needed to modify Elasticsearch’s logging configuration, e.g. to enable verbose logging for the IndexingMemoryController. We’ve removed the surrounding infrastructure in Rally a while ago. Therefore, Rally can just use the logging configuration that is shipped with Elasticsearch.

Implementation notes

Before applying the configuration in rally-teams, Rally wipes the Elaticsearch’s configuration directory:

https://github.com/elastic/rally/blob/24dee9ed704e5c98fc2999a665853ba4b2941586/esrally/mechanic/provisioner.py#L185

Then, it applies the configuration; it writes files in append mode (this allows mixins to contribute to the configuration):

https://github.com/elastic/rally/blob/24dee9ed704e5c98fc2999a665853ba4b2941586/esrally/mechanic/provisioner.py#L156-L166

A possible solution is to delete all but the log4j2.properties file and then apply the config as is. We should not hardcode that name though but instead introduce a “allowlist” concept (files to keep from the original config). The allowlist would be defined in rally-teams and evaluated by Rally. For backwards-compatibility we should also explicitly skip copying any files on the allowlist.

We also have a dedicated provisioner for the Docker image which writes config files to a directory on the host and then provides each file via a mount:

https://github.com/elastic/rally/blob/24dee9ed704e5c98fc2999a665853ba4b2941586/esrally/mechanic/provisioner.py#L466-L476

Here, it is sufficient to only skip copying any file on the allowlist.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
danielmitterdorfercommented, Oct 29, 2021

I don’t know what makes Docker different here, sorry.

The config files are already embedded in the Docker image. I think it’s sufficient that we just don’t provide a file outside the container and mount it. So it’s just the semantics of “overwriting” files in rally-teams are different but now that I think of it more I don’t think that’s a problem.

Nevertheless, we still have the issue with backwards-compatibility, both for Docker and the tar.gz distribution. So I still think a deny / allowlist concept is necessary, at least for a transition period.

0reactions
pquentincommented, Oct 29, 2021

I am also not certain whether I fully understand how your proposal would work with the Docker image?

I don’t know what makes Docker different here, sorry.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Logging | Elasticsearch Guide [8.5] | Elastic
Logging configuration edit ... Elastic strongly recommends using the Log4j 2 configuration that is shipped by default. Elasticsearch uses Log4j 2 for logging....
Read more >
How to set up logging level in Elasticsearch? - Stack Overflow
There are three ways to do it: A. By updating the cluster settings dynamically (doesn't require any restart): PUT /_cluster/settings ...
Read more >
Logger Settings in Elasticsearch - Efficient User
The logging configuration of Elasticsearch is placed in logging.yml. The default logger level is INFO. The logger level can be configured as ...
Read more >
Logging configuration
Elasticsearch uses Log4j 2 for logging. Log4j 2 can be configured using the log4j2.properties file. Elasticsearch exposes three properties, ...
Read more >
The Complete Guide to the ELK Stack - Logz.io
Elasticsearch is an open source, full-text search and analysis engine, based on the Apache Lucene search engine. Logstash is a log aggregator ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found