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

查看:33
本文介绍了在 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.

推荐答案

Application Data 目录似乎是一个完美的地方,但它是一个几乎不可见的区域.您需要为您的用户提供一种轻松访问它的方法.

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天全站免登陆