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

Complete Elasticsearch logger names #20457

Merged
merged 2 commits into from
Sep 14, 2016
Merged

Complete Elasticsearch logger names #20457

merged 2 commits into from
Sep 14, 2016

Conversation

jasontedor
Copy link
Member

This commit modifies the logger names within Elasticsearch to be the
fully-qualified class name as opposed removing the org.elasticsearch
prefix and dropping the class name. This change separates the root
logger from the Elasticsearch loggers (they were equated from the
removal of the org.elasticsearch prefix) and enables log levels to be
set at the class level (instead of the package level).

Closes #20326

This commit modifies the logger names within Elasticsearch to be the
fully-qualified class name as opposed removing the org.elasticsearch
prefix and dropping the class name. This change separates the root
logger from the Elasticsearch loggers (they were equated from the
removal of the org.elasticsearch prefix) and enables log levels to be
set at the class level (instead of the package level).
@jasontedor
Copy link
Member Author

retest this please

@abeyad
Copy link

abeyad commented Sep 13, 2016

LGTM

@jasontedor
Copy link
Member Author

retest this please

@jasontedor
Copy link
Member Author

jasontedor commented Sep 14, 2016

This pull request unearthed an issue that exists in master today regarding the hierarchy of setting logger levels. I opened #20463.

Today when associating a logger with a Lucene info stream component, we
equate all components with lucene.iw except for IFD which we associate
with lucene.ifd. This commit modifies this so that these logger names
are now derived from the component name in all cases (we simply append
the component name to the parent logger name, with a dot prefix).
@abeyad
Copy link

abeyad commented Sep 14, 2016

@jasontedor the Lucene logger name commit LGTM

@jasontedor jasontedor merged commit 7560101 into elastic:master Sep 14, 2016
@jasontedor jasontedor deleted the elasticsearch-logger-names branch September 14, 2016 02:46
@jasontedor
Copy link
Member Author

Thank you @abeyad.

jasontedor added a commit that referenced this pull request Sep 14, 2016
This commit modifies the logger names within Elasticsearch to be the
fully-qualified class name as opposed removing the org.elasticsearch
prefix and dropping the class name. This change separates the root
logger from the Elasticsearch loggers (they were equated from the
removal of the org.elasticsearch prefix) and enables log levels to be
set at the class level (instead of the package level).

Relates #20457
jasontedor added a commit that referenced this pull request Sep 14, 2016
This commit modifies the logger names within Elasticsearch to be the
fully-qualified class name as opposed removing the org.elasticsearch
prefix and dropping the class name. This change separates the root
logger from the Elasticsearch loggers (they were equated from the
removal of the org.elasticsearch prefix) and enables log levels to be
set at the class level (instead of the package level).

Relates #20457
} else {
return logger;
}
return Loggers.getLogger(parentLogger, "." + component);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this change inadvertently slowed down indexing: see annot AZ at https://benchmarks-old.elastic.co/index.html#indexing

The problem is (confusingly!) this private method is called for every log message that Lucene's IndexWriter makes. Previously, we invoked Loggers.getLogger just twice on creating LoggerInfoStream but now we are calling it for every log message.

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.

Elasticsearch logger names
4 participants