Home All Groups Group Topic Archive Search About

Where to store log file ?

Author
20 Jun 2006 12:02 PM
serge calderara
Dear all,

I have build a WIndows application that is deployed under 2000 or XP
workstation.
If I set to 1 the entry in <Diagnostics> elements of App.config file, then
it generates log file entry under a LOG folder located below the Installation
Folder in Program File.

Now problem comes when I am logged in as a restricted user, by default it
does not have write access to Program File folder, so it generates an IO
securtity execpetion when attempting to write under Program
File\myApplication\log

My question is :
Where is the best place to store such log files, mainly used as debug
purpose ?

Thanks for your help
regards

Author
20 Jun 2006 12:08 PM
Dominick Baier [DevelopMentor]
use the profile of the current interactive user.

you get the necessary paths using:

Environment.GetFolderPath(specialfolder)

the LocalApplicationData special folder may be the right one.

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

Show quoteHide quote
> Dear all,
>
> I have build a WIndows application that is deployed under 2000 or XP
> workstation.
> If I set to 1 the entry in <Diagnostics> elements of App.config file,
> then
> it generates log file entry under a LOG folder located below the
> Installation
> Folder in Program File.
> Now problem comes when I am logged in as a restricted user, by default
> it does not have write access to Program File folder, so it generates
> an IO securtity execpetion when attempting to write under Program
> File\myApplication\log
>
> My question is :
> Where is the best place to store such log files, mainly used as debug
> purpose ?
> Thanks for your help
> regards