Skip to content

Instantly share code, notes, and snippets.

@AndreBaumeier
Last active December 12, 2021 14:00
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save AndreBaumeier/2071de84ebaddb25770c6c6d5473a887 to your computer and use it in GitHub Desktop.
Save AndreBaumeier/2071de84ebaddb25770c6c6d5473a887 to your computer and use it in GitHub Desktop.
find log4j usages within your java applications. Requires installed JRE and jdeps.
#!/bin/bash
find . -type f -name '*jar' | while read line; do
LOG4JUSAGE=''
#echo "Processing file '$line'"
LOG4JUSAGE=$(jdeps "$line"|grep -i log4)
if [ ! -z "$LOG4JUSAGE" ]
then
echo "Processing file '$line'"
echo "found log4 references"
echo "$LOG4JUSAGE"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment