简体   繁体   中英

Where the application should store its logs in Mac OS?

I'm porting a Windows app written in C# to Mac OS using Java and Swing.

The Windows app stores the logs (environment info, exceptions, etc.) in the file C:\\Program Files\\MyProgram\\Logs\\app.log. Occasionally I ask users to send me this file to diagnose problems.

What is the right place for logs in Mac OS? If there are several possible places, I'd like to use the one that is easier for users to locate.

通常我们将它存储在主文件夹和.log文件中的dir [名称为app]中

System.getProperty("user.home")+System.getProperty("file.separator")+"appname"+System.getProperty("file.separator")+"appname.log"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM