Where should the application store its logs on Mac OS?

I am porting a Windows application written in C # on Mac OS using Java and Swing.

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

Which place is suitable for magazines on Mac OS? If there are several possible places, I would like to use one that is easier for users to find.

+6
java logging porting macos
source share
1 answer

we usually save it in the directory [with the application name] in the home folder and in this .log file

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

All Articles