R
Rick
Greetings.
I have a program that has a server and multiple clients. Each one
routes its SystemDiagnostics.Trace.WriteLine output to a file. The
target for the writelines is specified in the app.config file. For
example:
<listeners>
<add name="fileLogger"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="C:\Server\logfile.log" />
<remove name="Default" />
</listeners>
The problem is that I would like each of the clients to write to their
own log file. I tried this:
initializeData="~\logfile.log" />
(Each client is run by a different user.) And I tried this:
initializeData="$(USERPROFILE)\logfile.log" />
So both of those were attempts to use one app.config file for multiple
clients.
Another possibility is to have separate app.config files, and point
each client at a different one. By using an environment variable:
set APPCONFIG_PATH=C:\Jim\app.config
client.exe
Or by using some sort of switch on the command line:
client.exe -appconfig C:\Jim\app.config
This must have come up before. What is the usual solution?
Regards,
Rick
I have a program that has a server and multiple clients. Each one
routes its SystemDiagnostics.Trace.WriteLine output to a file. The
target for the writelines is specified in the app.config file. For
example:
<listeners>
<add name="fileLogger"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="C:\Server\logfile.log" />
<remove name="Default" />
</listeners>
The problem is that I would like each of the clients to write to their
own log file. I tried this:
initializeData="~\logfile.log" />
(Each client is run by a different user.) And I tried this:
initializeData="$(USERPROFILE)\logfile.log" />
So both of those were attempts to use one app.config file for multiple
clients.
Another possibility is to have separate app.config files, and point
each client at a different one. By using an environment variable:
set APPCONFIG_PATH=C:\Jim\app.config
client.exe
Or by using some sort of switch on the command line:
client.exe -appconfig C:\Jim\app.config
This must have come up before. What is the usual solution?
Regards,
Rick