Elasticsearch is running inside a docker container. Also, I do not need to preserve the data.
I have tried both /usr/share/elasticsearch/config/logging.yml (which seems to be ignored) and /usr/share/elasticsearch/config/log4j2.properties:(which gives "Exception in thread "main" org.apache.logging.log4j.core.config.ConfigurationException: No name attribute provided for Logger deprecation" and the container quickly exits). In both cases, I'm adding the line:
logger.deprecation.level = warn
After restarting the ES container, in /usr/share/elasticsearch/logs, I (still) have only one file: gc.log, which contains no occurrences of the string 'dep' (case insensitive).
My questions are:
What file should the deprecation logs appear in?
What do I need to do to get deprecation logs written with Elasticsearch 6.8?
By default, deprecation logging is enabled at the WARN level, the level at which all deprecation log messages will be emitted.
you should not need to configure anything in your logging configuration. If you remove any configuration, start elasticsearch and do something that is deprecated, there is no logfile being created? Have you tested that? If so, how exactly did you test that?
Is there anything else I should check? I'm told this is going to be an interesting upgrade, because we're using "types". Is it possible deprecation logging is enabled, but our use of types is going undetected anyway?
It gives lots of output, and a little about deprecation:
$ docker logs elasticsearch | egrep -i deprecat
below cmd output started 2019 Wed Sep 04 08:57:51 AM PDT
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
[2019-09-04T15:15:15,825][DEBUG][o.e.b.JarHell ] [wC8pkqS] examining jar: /usr/share/elasticsearch/modules/x-pack-deprecation/x-pack-deprecation-6.8.2.jar
[2019-09-04T15:15:15,863][DEBUG][o.e.b.JarHell ] [wC8pkqS] examining jar: /usr/share/elasticsearch/modules/x-pack-deprecation/x-pack-deprecation-6.8.2.jar
[2019-09-04T15:15:18,034][INFO ][o.e.p.PluginsService ] [wC8pkqS] loaded module [x-pack-deprecation]
[2019-09-04T15:27:36,091][WARN ][o.e.d.i.m.MapperService ] [wC8pkqS] Setting index.mapper.dynamic is deprecated since indices may not have more than one type anymore.
[2019-09-04T15:27:36,165][WARN ][o.e.d.i.m.MapperService ] [wC8pkqS] Setting index.mapper.dynamic is deprecated since indices may not have more than one type anymore.
[2019-09-04T15:40:13,137][WARN ][o.e.d.i.m.MapperService ] [wC8pkqS] Setting index.mapper.dynamic is deprecated since indices may not have more than one type anymore.
[2019-09-04T15:41:55,475][WARN ][o.e.d.i.m.MapperService ] [wC8pkqS] Setting index.mapper.dynamic is deprecated since indices may not have more than one type anymore.
[2019-09-04T15:45:54,357][WARN ][o.e.d.i.m.MapperService ] [wC8pkqS] Setting index.mapper.dynamic is deprecated since indices may not have more than one type anymore.
I ran into this post wheen googling about the same issue as Dan seems to be having regarding deprecation logging: When setting logger.deprecation.level = warn in log4j2.properties we're getting the error "ConfigurationException: No name attribute provided for Logger deprecation" (we're also planning to upgrade from 6.8 to 7.x).
We have always been seeing the warning messages about deprectated functionality when running docker log. However, from what I can understand based on the documentation, I'm expecting to see a separate file for the deprecation log messages (my emphasis):
This will create a daily rolling deprecation log file in your log directory. Check this file regularly, especially when you intend to upgrade to a new major version.
But I see no such file. We can of course go through the "regular" log file and search for deprecation messages, but it kind of defeats the purpose of having a dedicated setting for deprecation logging. Especially when the documentation encourages you to check this file regularly...
Could @spinscale or somebody else from the Elastic team verify if this is working as intended (and the documentation ought to be updated/clarified), or if I'm missing something?
Thank you for pointing that out to me Alexander. The differences in configuration is obvious when you see it, but given how "simple" it appeared to be according to the documentation, it wasn't all the clear... I'll open a GitHub issue suggesting an improvement.
And in case anybody else is looking for a solution to this exact issue, I solved it by copying these lines [37-52] into the log4j2.properties that I've mounted for my Docker image for Elasticsearch.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.