Log rotation elasticsearch problem


(Ruslan Zaytsev) #1

Good day!
I have problem with tuning log4j2.properties with manual https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html

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


(Ruslan Zaytsev) #2

elasticsearch.noarch 5.3.0-1


(Jason Tedor) #3

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.


(Ruslan Zaytsev) #4

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

@jasontedor Thank you!


(Jason Tedor) #5

You're welcome. :wink:


#6

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.


(Jason Tedor) #7

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


(system) #8

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