Nishit Kumar
Nishit Kumar

Reputation: 55

log4j upgrade in elasticsearch

Hello all I want to upgrade log4j in Elasticsearch the current version is shown below using the locate command , so which files I have to replace , also do I have to perform certain action after replacing the files

root@la-prod7-client1:/# locate log4j

/etc/elasticsearch/log4j2.properties

/usr/share/elasticsearch/lib/log4j-api-2.11.1.jar

/usr/share/elasticsearch/lib/log4j-core-2.11.1.jar

/usr/share/elasticsearch/modules/x-pack-core/log4j-1.2-api-2.11.1.jar

/usr/share/elasticsearch/modules/x-pack-identity-provider/log4j-slf4j-impl-2.11.1.jar

/usr/share/elasticsearch/modules/x-pack-security/log4j-slf4j-impl-2.11.1.jar

elastic version is 7.10.2 JVM 15.0.1

I need to know the steps i have to follow in order to upgrade log4j from 2.11.1 to 2.16.0

Upvotes: 2

Views: 6436

Answers (1)

bilalcaliskan
bilalcaliskan

Reputation: 31

Upgrading a single library dependency is not a good practice at all. I suggest to either upgrade Elasticsearch to 7.16.1 for 7.x or 6.8.21 for 6.x.

Another solution is to append below to your /etc/elasticsearch/jvm.options:

-Dlog4j2.formatMsgNoLookups=true

Upvotes: 3

Related Questions