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

Give useful error message if log config is missing #20493

Merged
merged 1 commit into from
Sep 15, 2016
Merged

Give useful error message if log config is missing #20493

merged 1 commit into from
Sep 15, 2016

Conversation

jasontedor
Copy link
Member

@jasontedor jasontedor commented Sep 15, 2016

Today when starting Elasticsearch without a Log4j 2 configuration file,
we end up throwing an array index out of bounds exception. This is
because we are passing no configuration files to Log4j. Instead, we
should throw a useful error message to the user. This commit modifies
the Log4j configuration setup to throw a user exception if no Log4j
configuration files are present in the config directory.

@jasontedor
Copy link
Member Author

jasontedor commented Sep 15, 2016

This provides:

21:43:57 ⌁ [jason:~] $ ~/elasticsearch/elasticsearch-6.0.0-alpha1-SNAPSHOT/bin/elasticsearch
ERROR: no log4j2.properties found; tried [/Users/jason/elasticsearch/elasticsearch-6.0.0-alpha1-SNAPSHOT/config] and its subdirectories
21:50:13 ⌁ [jason:~] 78 $ 

@abeyad
Copy link

abeyad commented Sep 15, 2016

LGTM

1 similar comment
@dakrone
Copy link
Member

dakrone commented Sep 15, 2016

LGTM

Today when starting Elasticsearch without a Log4j 2 configuration file,
we end up throwing an array index out of bounds exception. This is
because we are passing no configuration files to Log4j. Instead, we
should throw a useful error message to the user. This commit modifies
the Log4j configuration setup to throw a user exception if no Log4j
configuration files are present in the config directory.
@jasontedor jasontedor merged commit 7132fcd into elastic:master Sep 15, 2016
@jasontedor jasontedor deleted the missing-log4j2 branch September 15, 2016 11:44
jasontedor added a commit that referenced this pull request Sep 15, 2016
Today when starting Elasticsearch without a Log4j 2 configuration file,
we end up throwing an array index out of bounds exception. This is
because we are passing no configuration files to Log4j. Instead, we
should throw a useful error message to the user. This commit modifies
the Log4j configuration setup to throw a user exception if no Log4j
configuration files are present in the config directory.

Relates #20493
jasontedor added a commit that referenced this pull request Sep 15, 2016
Today when starting Elasticsearch without a Log4j 2 configuration file,
we end up throwing an array index out of bounds exception. This is
because we are passing no configuration files to Log4j. Instead, we
should throw a useful error message to the user. This commit modifies
the Log4j configuration setup to throw a user exception if no Log4j
configuration files are present in the config directory.

Relates #20493
@jasontedor
Copy link
Member Author

Thanks @abeyad and @dakrone.

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

Successfully merging this pull request may close these issues.

4 participants