You can only use that {$...} notation in log4j configuration files where the ... part is a system property. So: you could set up a system property containing the value you want. But bear in mind that a system property is JVM-wide so it would be the same for all web applications.
Anyway, if you don't find a solution to this it is probably a good thing. Trying to log to files inside a web application is not really a good idea; all your logs would disappear when you installed a new version of the application.