Log rotation elasticsearch problem

Good day!
I have problem with tuning log4j2.properties with manual Configuring Elasticsearch | Elasticsearch Guide [8.11] | Elastic

after add this code

appender.rolling.strategy.type = DefaultRolloverStrategy
appender.rolling.strategy.action.type = Delete
appender.rolling.strategy.action.basepath = ${sys:es.logs.base_path}
appender.rolling.strategy.action.condition.type = IfLastModified
appender.rolling.strategy.action.condition.age = 7D
appender.rolling.strategy.action.PathConditions.type = IfFileName
appender.rolling.strategy.action.PathConditions.glob = ${sys:es.logs.cluster_name}-*

i get errors in log

апр 10 13:26:29 default-centos-72.vagrantup.com elasticsearch[14253]: 2017-04-10 13:26:29,247 main ERROR Unable to locate plugin type for DefaultRolloverStrategy
апр 10 13:26:29 default-centos-72.vagrantup.com elasticsearch[14253]: 2017-04-10 13:26:29,362 main ERROR Unable to locate plugin for IfLastModified
апр 10 13:26:29 default-centos-72.vagrantup.com elasticsearch[14253]: 2017-04-10 13:26:29,362 main ERROR Unable to locate plugin for IfFileName
апр 10 13:26:29 default-centos-72.vagrantup.com elasticsearch[14253]: 2017-04-10 13:26:29,363 main ERROR Unable to locate plugin for Delete
апр 10 13:26:29 default-centos-72.vagrantup.com elasticsearch[14253]: 2017-04-10 13:26:29,363 main ERROR Unable to locate plugin for DefaultRolloverStrategy
апр 10 13:26:29 default-centos-72.vagrantup.com elasticsearch[14253]: 2017-04-10 13:26:29,367 main ERROR Unable to inject fields into builder class for plugin type class org.apache.logging.log4j.core.appender.RollingFileAppender, element RollingFile. java.lang.NullPointerException

one string

appender.rolling.strategy.type = DefaultRolloverStrategy

doing error message as

апр 10 13:31:01 default-centos-72.vagrantup.com elasticsearch[14345]: 2017-04-10 13:31:01,106 main ERROR Unable to locate plugin type for DefaultRolloverStrategy
апр 10 13:31:01 default-centos-72.vagrantup.com elasticsearch[14345]: 2017-04-10 13:31:01,201 main ERROR Unable to locate plugin for DefaultRolloverStrategy
апр 10 13:31:01 default-centos-72.vagrantup.com elasticsearch[14345]: 2017-04-10 13:31:01,204 main ERROR Unable to inject fields into builder class for plugin type class org.apache.logging.log4j.core.appender.RollingFileAppender, element RollingFile. java.lang.NullPointerException

Help me, please

elasticsearch.noarch 5.3.0-1

I think that you copied and pasted these lines directly from the docs and ended up with spaces at the end of each line (and I see spaces at the end of each of your lines here). This confuses Log4j. Remove these extraneous spaces and you should be fine.

5 Likes

I am confused :frowning:
It is really spaces :frowning:

@jasontedor Thank you!

You're welcome. :wink:

A hint "Look for spaces at the end of each line when copying from this site" would have saved me some hours from testing too.

I opened https://github.com/elastic/elasticsearch/pull/24198.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.