From 6d269a39f351ac6a62ca3ad67f35486e4feec0ed Mon Sep 17 00:00:00 2001 From: Joe Adams Date: Thu, 17 Oct 2024 12:22:12 -0400 Subject: [PATCH] Update changelog and readme for logging changes - Update README to include section about configuring the logging settings. - Update CHANGELOG with information about breaking changes in the logging output from #942. Signed-off-by: Joe Adams --- CHANGELOG.md | 5 ++++- README.md | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cc0e3ac..940dfe9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,10 @@ BREAKING CHANGES: The flag `--es.slm` has been renamed to `--collector.slm`. -* [CHANGE] Rename --es.slm to --collector.slm #XXX +The logging system has been replaced with log/slog from the stdlib. This change is being made across the prometheus ecosystem. The logging output has changed, but the messages and levels remain the same. The `ts` label for the timestamp has bewen replaced with `time`, the accuracy is less, and the timezone is not forced to UTC. The `caller` field has been replaced by the `source` field, which now includes the full path to the source file. The `level` field now exposes the log level in capital letters. + +* [CHANGE] Rename --es.slm to --collector.slm #932 +* [CHANGE] Replace logging system #942 ## 1.8.0 / 2024-09-14 diff --git a/README.md b/README.md index a7fa6e0e..64948429 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ elasticsearch_exporter --help | Argument | Introduced in Version | Description | Default | | ----------------------- | --------------------- |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ----------- | -| collector.clustersettings| 1.6.0 | If true, query stats for cluster settings (As of v1.6.0, this flag has replaced "es.cluster_settings"). | false | +| collector.clustersettings| 1.6.0 | If true, query stats for cluster settings (As of v1.6.0, this flag has replaced "es.cluster_settings"). | false | | es.uri | 1.0.2 | Address (host and port) of the Elasticsearch node we should connect to. This could be a local node (`localhost:9200`, for instance), or the address of a remote Elasticsearch server. When basic auth is needed, specify as: `://:@:`. E.G., `http://admin:pass@localhost:9200`. Special characters in the user credentials need to be URL-encoded. | | | es.all | 1.0.2 | If true, query stats for all nodes in the cluster, rather than just the node we connect to. | false | | es.indices | 1.0.2 | If true, query stats for all indices in the cluster. | false | @@ -78,6 +78,10 @@ For versions greater than `1.1.0rc1`, commandline parameters are specified with The API key used to connect can be set with the `ES_API_KEY` environment variable. +#### Logging + +Logging by the exporter is handled by the `log/slog` package. The output format can be customized with the `--log.format` flag which defaults to logfmt. The log level can be set with the `--log.level` flag which defaults to info. The output can be set to either stdout (default) or stderr with the `--log.output` flag. + #### Elasticsearch 7.x security privileges Username and password can be passed either directly in the URI or through the `ES_USERNAME` and `ES_PASSWORD` environment variables.