OpenSearch/docs/reference
Nik Everett 22459576d7
Logging: Make node name consistent in logger (#31588)
First, some background: we have 15 different methods to get a logger in
Elasticsearch but they can be broken down into three broad categories
based on what information is provided when building the logger.

Just a class like:
```
private static final Logger logger = ESLoggerFactory.getLogger(ActionModule.class);
```
or:
```
protected final Logger logger = Loggers.getLogger(getClass());
```

The class and settings:
```
this.logger = Loggers.getLogger(getClass(), settings);
```

Or more information like:
```
Loggers.getLogger("index.store.deletes", settings, shardId)
```

The goal of the "class and settings" variant is to attach the node name
to the logger. Because we don't always have the settings available, we
often use the "just a class" variant and get loggers without node names
attached. There isn't any real consistency here. Some loggers get the
node name because it is convenient and some do not.

This change makes the node name available to all loggers all the time.
Almost. There are some caveats are testing that I'll get to. But in
*production* code the node name is node available to all loggers. This
means we can stop using the "class and settings" variants to fetch
loggers which was the real goal here, but a pleasant side effect is that
the ndoe name is now consitent on every log line and optional by editing
the logging pattern. This is all powered by setting the node name
statically on a logging formatter very early in initialization.

Now to tests: tests can't set the node name statically because
subclasses of `ESIntegTestCase` run many nodes in the same jvm, even in
the same class loader. Also, lots of tests don't run with a real node so
they don't *have* a node name at all. To support multiple nodes in the
same JVM tests suss out the node name from the thread name which works
surprisingly well and easy to test in a nice way. For those threads
that are not part of an `ESIntegTestCase` node we stick whatever useful
information we can get form the thread name in the place of the node
name. This allows us to keep the logger format consistent.
2018-07-31 10:54:24 -04:00
..
aggregations fix no=>not typo (#32463) 2018-07-31 13:33:23 +01:00
analysis Add exclusion option to `keep_types` token filter (#32012) 2018-07-17 09:04:41 +02:00
cat Docs: Use the default distribution to test docs (#31251) 2018-06-18 12:06:42 -04:00
cluster Update update-settings.asciidoc (#31378) 2018-07-26 17:16:53 +02:00
commands [DOCS] Moves commands to docs folder (#31114) 2018-06-06 07:49:15 -07:00
docs Docs: Explain _bulk?refresh shard targeting 2018-07-05 16:24:03 -04:00
how-to Use correct formatting for links (#29460) 2018-07-16 21:11:24 +02:00
images
index-modules Logging: Make node name consistent in logger (#31588) 2018-07-31 10:54:24 -04:00
indices update rollover to leverage write-alias semantics (#32216) 2018-07-30 14:32:55 -07:00
ingest INGEST: Extend KV Processor (#31789) (#32232) 2018-07-20 22:32:50 +02:00
licensing [DOCS] Fix licensing API details (#31667) 2018-06-28 15:38:41 -07:00
mapping Ensure that field aliases cannot be used in multi-fields. (#32219) 2018-07-20 00:18:54 -07:00
migration Remove aliases resolution limitations when security is enabled (#31952) 2018-07-20 09:23:32 +02:00
modules Remove indication of future multi-homing support (#32187) 2018-07-19 11:33:46 +01:00
monitoring [DOCS] Move monitoring to docs folder (#31477) 2018-06-22 15:39:34 -07:00
query-dsl Update Fuzzy Query docs to clarify default behavior re max_expansions (#30819) 2018-07-30 13:19:26 -07:00
release-notes Percentile/Ranks should return null instead of NaN when empty (#30460) 2018-06-18 10:01:28 -04:00
rest-api [DOCS] Move migration APIs to docs (#31473) 2018-06-21 08:19:23 -07:00
search Add ERR to ranking evaluation documentation (#32314) 2018-07-24 19:58:34 +02:00
settings [DOCS] Adds recommendation for xpack.security.enabled (#32345) 2018-07-25 09:51:40 -07:00
setup Logging: Make node name consistent in logger (#31588) 2018-07-31 10:54:24 -04:00
sql SQL: Remove restriction for single column grouping (#31818) 2018-07-06 20:55:27 +03:00
testing [Docs] Use capital letters in section headings (#31678) 2018-06-29 11:58:39 +02:00
upgrade [DOCS] Clarified that you must remove X-Pack plugin when upgrading from pre-6.3. (#32016) 2018-07-20 14:17:48 -07:00
aggregations.asciidoc
analysis.asciidoc [Docs] Add clarification to analysis example (#31826) 2018-07-06 14:36:58 +02:00
api-conventions.asciidoc Default to one shard (#30539) 2018-05-14 12:22:35 -04:00
cat.asciidoc Rename the bulk thread pool to write thread pool (#29593) 2018-04-19 08:18:58 -04:00
cluster.asciidoc rest-high-level: added get cluster settings (#31706) 2018-07-02 13:25:17 -04:00
docs.asciidoc
getting-started.asciidoc DOCS: put LIMIT 10 to the SQL query (#32065) 2018-07-16 16:09:56 -04:00
glossary.asciidoc Default to one shard (#30539) 2018-05-14 12:22:35 -04:00
gs-index.asciidoc
how-to.asciidoc
index-modules.asciidoc Document woes between auto-expand-replicas and allocation filtering (#30531) 2018-05-14 12:14:37 +02:00
index.asciidoc [DOCS] Move sql to docs (#31474) 2018-06-22 15:40:25 -07:00
index.x.asciidoc [DOCS] Removes redundant index.asciidoc files (#30707) 2018-05-18 11:05:40 -07:00
indices.asciidoc
ingest.asciidoc
mapping.asciidoc Add support for field aliases. (#32172) 2018-07-18 09:33:09 -07:00
modules.asciidoc
query-dsl.asciidoc
redirects.asciidoc [Docs] Clarify `fuzzy_like_this` redirect (#30183) 2018-05-02 11:45:37 +02:00
release-notes.asciidoc
search.asciidoc
setup.asciidoc [DOCS] Starting Elasticsearch (#31701) 2018-07-03 13:40:37 -07:00
testing.asciidoc
upgrade.asciidoc Revert "[DOCS] Added 6.3 info & updated the upgrade table. (#30940)" 2018-06-11 22:04:36 -04:00