EL 4.1 Application Logging errors with file location variables

I am using Enterprise LIbrary 4.1 and the logging application block for multiple applications. I have a separate logging configuration file that contains 4 listeners total so the logging configuration is externalized from each applications app.config
file.

4 Applications

Client A - File Listener

Client B- File Listener

Web A - Event Listener

Web B - Event Listener

The problem occurs when I use a user variable (%USERPROFILE%\AppData\Roaming\App\LogFiles\Tools.log) for the client file listeners log file location. When placed on the web server I get an error when logging is initialized. Here is the error.

Since you don't want to have two config files, your option then would be to modify the config programmatically. The modification will be based on the permission set on the filepath where you want to put your log file. Here is a sample code on
how to modify the config during runtime.

Note that while your solution would work it would be costly to implement in multiple applications (4-5 web applications and 8-10 client applications). This would defeat the purpose as it would modify the file incorrectly for other applications.
This file maybe used by multiple applications at the same time. Each needs to have it's configuration set properly. Our solution has a fall back method so the applications look in a common location and if not found then the local bin folder to
the application.

To resolve this I am going to do the following.

1. Modify our common logging solution to look in the bin folder first (as an override) and then the common directory. This will require two separate files (didn't want this) but may have too.

2. For the web applications a file without the variable paths will be placed in the common location and one with the variables in the local bin folder to the client applications.

If anyone has any other solutions please post - it maybe helpful for others.