Reputation: 712
I'm developing a cross-platform desktop application for Mac, Linux and Windows. The application will create a plain-text log file to help with debugging, amongst other things. What are people's recommendations for a sensible place to store the log on each of the platforms?
Here is my guess so far, based on web searches:
~/Library/Logs/MY-APP-NAME/system.log
~/.MY-APP-NAME/logs/system.log
%APPDATA%\MY-APP-NAME\logs\system.log
Upvotes: 2
Views: 669
Reputation: 33719
For Linux, the XDG Base Directory Specification is followed by some applications. Log files are not specifically called out as such. You can put them either into a subdirectory of the data directory ($XDG_DATA_HOME
or $HOME/.local/share
), where they will not be deleted automatically, or you could use a subdirectory of the cache directory ($XDG_CACHE
or $HOME/.cache
). In the latter case, the files could be automatically expired after some time.
Upvotes: 1