How to change the name of the logfile at startup?

Sep 3, 2012 at 9:47 PM

My agentdesktop.exe is run simultaneously by many users using citrix so I need that the log file created by Microsoft.Uii.Common.Logging is named differently for each user. I've tried a few things in the program.cs with the Common.Providers namespace but no luck. Any idea how to do this?

Thanks.

Sep 4, 2012 at 10:50 AM
Edited Sep 4, 2012 at 10:58 AM

hey dtriana,

interesting question. i've managed to implement a quick and dirty solution using reflection. but that shouldn't be the way.

It should be possible to intercept the "Logging-initialization" where the Listeners are pulled out of the App.config

Anybody some ideas ?

 

ndi

Sep 12, 2012 at 3:14 PM

The name of the log file is in the app.confg file for the desktop.

Look for this line :

<add name="LoggingLogFile" 
	type="Microsoft.Uii.Common.Logging.Providers.LoggingLogFile, Microsoft.Uii.Common.Logging.Providers" 
	logfile="UIIDesktop.log" appname="Uii" />

You can change it there.

 

You can also create custom log providers for UII to route your log events to other sources, there are examples of this in the UII Samples directory and in the doc's for UII.

 

 

Mattb-msft.