Where to store an application log file on Windows

后端 未结 7 805
南笙
南笙 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:30

    If you EXPECT something to go wrong put it in the user's local Application Data directory.

    If you don't and just want to log anyways I might think about really using the temp directory. The reasoning for this is simple. If the application is only run once you will leave trash in the Application Data directory otherwise that nobody will ever need again. In the temp you have at least the CHANCE that it's going to be cleaned up later.

    BTW: IMHO the best would be not not create the log AS A FILE at all (log to memory) until something goes wrong. Then you can still offer a dialog where the user selects where to save the log.

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