Andrew Fletcher published: 13 December 2021 1 minute read
Like many devs at the moment, looking for log4j2 on your server... how to do?
First I used the command
find / -name log4j2.xml -type f
Which in turn produced the following results
/opt/solr-8.5.2/server/resources/log4j2.xml /var/solr/log4j2.xml
Version
Ok, so log4j2 exists on the server the client is using... in Solr. How about determining the version number?
The version here matters as 2.15.0 is good to go. To find the version use
sudo find / -name 'log4j*'
The output of this command returns
/opt/solr-8.5.2/licenses/log4j-api-2.11.2.jar.sha1 /opt/solr-8.5.2/licenses/log4j-core-2.11.2.jar.sha1 /opt/solr-8.5.2/licenses/log4j-api-NOTICE.txt /opt/solr-8.5.2/licenses/log4j-web-LICENSE-ASL.txt /opt/solr-8.5.2/licenses/log4j-slf4j-impl-2.11.2.jar.sha1 /opt/solr-8.5.2/licenses/log4j-1.2-api-2.11.2.jar.sha1 /opt/solr-8.5.2/licenses/log4j-web-NOTICE.txt /opt/solr-8.5.2/licenses/log4j-NOTICE.txt /opt/solr-8.5.2/licenses/log4j-core-LICENSE-ASL.txt /opt/solr-8.5.2/licenses/log4j-LICENSE-ASL.txt /opt/solr-8.5.2/licenses/log4j-slf4j-LICENSE-ASL.txt /opt/solr-8.5.2/licenses/log4j-api-LICENSE-ASL.txt /opt/solr-8.5.2/licenses/log4j-core-NOTICE.txt /opt/solr-8.5.2/licenses/log4j-slf4j-NOTICE.txt /opt/solr-8.5.2/licenses/log4j-web-2.11.2.jar.sha1 /opt/solr-8.5.2/server/resources/log4j2-console.xml /opt/solr-8.5.2/server/resources/log4j2.xml /opt/solr-8.5.2/server/lib/ext/log4j-1.2-api-2.11.2.jar /opt/solr-8.5.2/server/lib/ext/log4j-web-2.11.2.jar /opt/solr-8.5.2/server/lib/ext/log4j-api-2.11.2.jar /opt/solr-8.5.2/server/lib/ext/log4j-core-2.11.2.jar /opt/solr-8.5.2/server/lib/ext/log4j-slf4j-impl-2.11.2.jar /opt/solr-8.5.2/contrib/prometheus-exporter/lib/log4j-api-2.11.2.jar /opt/solr-8.5.2/contrib/prometheus-exporter/lib/log4j-core-2.11.2.jar /opt/solr-8.5.2/contrib/prometheus-exporter/lib/log4j-slf4j-impl-2.11.2.jar /var/solr/log4j2.xml
The version being used is 2.11.2. Now knowing the version is below 2.15.0, time to update.
Related articles
Andrew Fletcher
•
04 Jun 2024
No results showing for your Solr instance - solr.service: Failed with result 'exit-code'
When Solr is displaying results on the site, first step is to log in the server and check its status● solr.service - LSB: Controls Apache Solr as a Service
Loaded: loaded (/etc/init.d/solr; generated)
Active: failed (Result: exit-code) since Wed 2024-04-17 23:22:52 UTC; 6h ago
...
Andrew Fletcher
•
17 Feb 2024
Drupal - Solr working through tm_X3b_en_body error
Having updated Solr, re-indexing wasn't working. The error in the logs wasDrupal\search_api_solr\SearchApiSolrException while indexing item entity:node/2386:en: Solr endpoint http://127.0.0.1:8983/ bad request (code: 400, body: Exception writing document id...
Andrew Fletcher
•
17 Feb 2024
Solr commands
On an Ubuntu 20.02 system with Nginx, you can utilize the following commands to handle Solr:To verify the status of the Solr servicesudo systemctl status solrTo restart the Solr servicesudo systemctl restart solrStart Solrsudo systemctl start solrStop Solrsudo systemctl stop solrEnable Solr (Start...