Logging Block - Setting the path using SHGetFolderPath

Topics: Logging Application Block
Jul 16, 2008 at 11:35 AM
By default, the Logging Block seems to put the file in the app folder.  This doesn't seem to fit with the Microsoft design recommendations* which I interpret as saying it should go in CSIDL_LOCAL_APPDATA or, possibly, CSIDL_COMMON_APPDATA.  I can't see a way to do this easily but I'm new to the Enterprise Library.  Can anyone help or point me in the right direction?

I'm stuck with EL 3.1 because I have to use .NET 2.0: we haven't rolled out 3.5, yet.

* The latest one I can find is Designed for Windows XP spec v2.3.doc - refer to section 3.2 - Classify and store application data correctly
Jul 16, 2008 at 3:05 PM
Hi,

The best you can do in v3.1 is to use a custom trace listener that allows environment variables in the log file name, or using full paths.

Fernando


SSG31415926 wrote:
By default, the Logging Block seems to put the file in the app folder.  This doesn't seem to fit with the Microsoft design recommendations* which I interpret as saying it should go in CSIDL_LOCAL_APPDATA or, possibly, CSIDL_COMMON_APPDATA.  I can't see a way to do this easily but I'm new to the Enterprise Library.  Can anyone help or point me in the right direction?

I'm stuck with EL 3.1 because I have to use .NET 2.0: we haven't rolled out 3.5, yet.

* The latest one I can find is Designed for Windows XP spec v2.3.doc - refer to section 3.2 - Classify and store application data correctly


Jul 17, 2008 at 7:24 PM
I can't use full paths - they need to be user-specific so that this will run under terminal services as well as natively on XP.
Jul 17, 2008 at 9:33 PM
Then you need to go for the custom trace listener that does environment variables.

SSG31415926 wrote:
I can't use full paths - they need to be user-specific so that this will run under terminal services as well as natively on XP.