This issue is really about a single application instance logging separate files for each user. For example, an authenticated web service knows the identity of the calling user, actions performed by the service on behalf of the use could be logged into separate files for each user.
There are two ways to achieve this.
Firstly to evaluate the file name on a per event basis and open the appropriate file per event. This can be optimised by only closing and reopening the file if the name changes from one event to the next. This still could cause quite a large overhead. This is technically possible using the FileAppender's pluggable locking model objects, however this would 'confuse' the appender with respect to headers and footers.
Secondly to create a FileAppender for each output file, these appenders are held open behind a router appender that selects the appropriate appender to write to. If no appropriate appender currently exists then one is created. This requires a second level of templating and the ability to parse a fragment of XML config. This has been implemented in log4j 1.3.