> From the look of it, it’s not just an edge case of jndi either, it seems it’s the purpose of the whole prefix?
The original purpose of JNDI, back in the "the network is the computer" days at Sun, was all about accessing remote objects without having to care about where they were located.
The current use of JNDI, however, is about accessing resources external to the current J2EE web application, but still within the same JVM instance. For instance, using the JNDI name "java:comp/env/jdbc/something" to access a database configured on the application server.
It's this last use which AFAIK was the motivation for adding that lookup to log4j: it allows adding some metadata about the current web application context to the log output. The original use of JNDI, to access remote resources, has mostly been forgotten, and could be considered a vestigial feature nowadays.