Where to store an application log file on Windows

后端 未结 7 809
南笙
南笙 2020-12-09 08:05

Where would be the best \"standard\" place to put an application\'s debug log file in a Windows user environment?

In this particular case, it is an application that

相关标签:
7条回答
  • 2020-12-09 08:08

    The "standard" place for the log would be the AppData directory. However, really its up to you where you want to store them. As they are administrator (power users) then there should be no problems storing the logs in the same directory as the application being run. Even in the MyDocuments of the user would be a good shout.

    0 讨论(0)
  • 2020-12-09 08:13

    Assuming you want to keep log files around a significant amount of time and they are intended to be used, read I would put the log file in a sub-folder of the user's local application data folder, accessible from windows explorer by typing %localappdata%.

    If they are temporary log files, only to be used in the event of system diagnostics then you should put them in the temporary folder, accessible from windows explorer %temp%.

    0 讨论(0)
  • 2020-12-09 08:21

    The Application Data directory would seem to be the perfect place, but it's an area that is nearly invisible. You need to give your users an easy way to get to it.

    Have your installation script create a Log folder in the Application Data area for your program, and include a link to the folder in your Start menu.

    0 讨论(0)
  • 2020-12-09 08:24

    1.The program directory <- not good. Ideally you will only have RX permissions on this folder.

    2.The user's desktop <- technically can be done, but I don't like this idea. Polluting desktop... I, as a user, don't like it.

    3.The user's local Application Data directory. <- better

    My preference is a subdirectory under the program directory (with a clear name like "DebugLog" or something similar). Permissions on that subdirectory should allow creating and writing files ("Change" will be fine)

    0 讨论(0)
  • 2020-12-09 08:27

    In the organization I work for we use the (%TEMP% or %TMP%)\CompanyOrProductName\Logs directory Using %APPDATA% may be problematic with roaming profiles if the logs are numerous or huge : it slows their login process ...

    0 讨论(0)
  • 2020-12-09 08:29

    Windows Temp Folder

    0 讨论(0)
提交回复
热议问题