Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to store an application log file on 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. The program directory
  2. The user's desktop
  3. The user's local Application Data directory.

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.

like image 380
Darcy Casselman Avatar asked Oct 15 '09 14:10

Darcy Casselman


People also ask

Where are application logs stored in Windows?

Windows stores event logs in the C:\WINDOWS\system32\config\ folder. Application events relate to incidents with the software installed on the local computer. If an application such as Microsoft Word crashes, then the Windows event log will create a log entry about the issue, the application name and why it crashed.

How do I store Windows Logs?

Open the Event Viewer. Right-click the log name (for example, System) under Windows Logs in the left pane and select Properties. Change the Log path value to the location of the created folder and leave the log file name at the end of the path (for example, C:\EventLogs\System. evtx).

Where are log files kept?

Most log files are located in the /var/log/ directory. Some applications such as httpd and samba have a directory within /var/log/ for their log files. You may notice multiple files in the log file directory with numbers after them. These are created when the log files are rotated.


1 Answers

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.

like image 199
Mark Ransom Avatar answered Oct 19 '22 06:10

Mark Ransom