Where is the better place to write Logfiles?

Topics: General discussion, Logging Application Block
Nov 4, 2009 at 4:53 PM


  I've developed an application that register user events in LogFiles and I want to differentiate between user sessions.

  I was writing the Logs in the TemporalPath (C:\Documents and Settings\User\Local Settings\Temp\AppFolder) for each user, but I'm not sure that it is the right way.

Can you suggest me a folder or practice to store Logs?

Nov 5, 2009 at 5:56 AM


I think your solution is correct. But you can try using the %APPDATA% environment variable which will eventually log to "C:\Documents and Settings\{username}\Application Data" Application Data of the currently logged user.

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.

Nov 5, 2009 at 1:46 PM
Hi, Thanks by your advice, I think "Application Data" is a good solution to the Logs. But now my doubt is by the contrary case, if I want have the logs for all users in just one file. In what folder you suggest me store that file? Maybe C:\Documents and Settings\All Users\... or exist a special folder?
Nov 6, 2009 at 3:15 AM

In my opinion, I think it's good to have logs inside the folder where the application which generate that logs resides.  It's logical for users to look first in that directory and besides, it clearly shows what application owns that log file.


Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.