Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to save application logs? [duplicate]

Possible Duplicate:
Where to store an application log file on Windows

Windows seems to have several places where different applications store its logs. Windows services and some applications use the Windows event log, others use C:\ProgramData, another one store them to C:\Users(Local/System/Public/Default)\AppData/(Roaming/Local).

I noticed this when developing Windows services that the default (AppData/Roaming) environment variable points to something like C:\Windows\System32\Users\system\AppData\Roaming or other completely ridiculous locations, so I'm wondering if there's any sheet out there where to store logs for: User Applications/User Services/System Services and more general: What are all these application folders for (What belongs where?)

Thanks!

like image 321
user1450661 Avatar asked Dec 08 '22 20:12

user1450661


2 Answers

For user specific logs:

  • LocalApplicationData - %APPDATA%/Local/...

For user specific logs tied to the users profile:

  • ApplicationData - %APPDATA%/Roaming/...

For all other logs:

  • CommonApplicationData - %ALLUSERSPROFILE%/...

See Environment.SpecialFolder for other folders.

like image 97
James Avatar answered Jan 04 '23 11:01

James


The standard place for the log would be the AppData directory
Using %APPDATA% may be problematic with roaming profiles if the logs are numerous or huge : it slows their login process then u can use directory %TEMP% i.e. windows temperory director

like image 30
Ravindra Bagale Avatar answered Jan 04 '23 10:01

Ravindra Bagale