在Windows上的哪里存储应用程序日志文件 [英] Where to store an application log file on Windows

查看:660
本文介绍了在Windows上的哪里存储应用程序日志文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将应用程序的调试日志文件放在Windows用户环境中的最佳标准"位置在哪里?

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 is run once and could go wrong. It will be run by system administrator types who may need to inspect the log after the application is run. Everytime the application is run, a new log file is created.

到目前为止已浮动的选项包括:

Options that have been floated so far include:

  1. 程序目录
  2. 用户的桌面
  3. 用户的本地应用程序数据"目录.

我最喜欢,但是我想知道SO共识是什么.

I have my favourite, but I wondered what the SO consensus was.

注意:这类似于此问题,但是我们正在处理一个应用程序,该应用程序只能由一个用户运行一次.

Note: this is similar to this question, but we're dealing with an application that's only likely to be run once by one user.

推荐答案

应用程序数据"目录似乎是完美的选择,但这是一个几乎不可见的区域.您需要为用户提供一种简便的方法.

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.

这篇关于在Windows上的哪里存储应用程序日志文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆