Prevent foreign_key_for? from type casting all attributes
Revert "Only lookup `config.log_level` for stdlib `::Logger`. Closes #11665."

This reverts commit e0a521cfcd13e4d1f0ae8ab96004289e1c020f71.

Conflicts:
	railties/CHANGELOG.md

We expect loggers to quack like stdlib logger. If log4r needs different
level= assignment, using a Logger-quacking wrapper is the way to do it.

Fixes #14114.
Merge pull request #14140 from WojtekKruszewski/optimize_foreign_key_for

Prevent foreign_key_for? from evaluating all attributes