This commit upgrades the Log4j 2 dependency to version 2.7 and removes some hacks that we had in place to work around bugs in Log4j 2 version 2.6.2. Relates #20805