If log4j is such a fundamentally bad idea, surely we should expect our tools to stop such ideas from ever being implemented.
In the same way that modern languages are memory-safe (disallowing pointer arithmetic, because it's proven to be a terrible idea), a real modern language would disallow log4j by being capability-safe.