Logging - Can you set the path to the log file to a users personal folder?

Topics: Logging Application Block
Apr 24, 2009 at 7:21 PM
Some users of our application do not have rights to the folder the app is running in.  Is there a way to specify the users personal folder that doesn't break if that personal folder has been renamed/redirected (ie My Documents in XP)? 
Apr 26, 2009 at 5:14 AM
Hi,

As far as I know, you can use environment variables in the logging path of the tracelistener(Rolling Flat file and Flat File), it supports WINDIR%, %TEMP%, and %USERPROFILE%. Please refer to the documentation for more details. 

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Apr 28, 2009 at 10:32 PM
I'm looking for something with the same functionality as the System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal) call in C#, since it is not known if the users personal folder is "My Documents" , "Documents", or something else.
Apr 29, 2009 at 6:17 AM
Hi,

IMHO, looking at the source code of the Logging Application Block, I It would not be able to support the functionality you are looking for. The Logging Application Block just replaces the Environment variables and then constructs the path. One thing I can think off, is you can implement your own custom trace listener with your custom functionality.

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com