bardsoftware / ganttproject

Official GanttProject repository.
http://ganttproject.biz
GNU General Public License v3.0
864 stars 303 forks source link

Change logs directory #1309

Open m0squito opened 8 years ago

m0squito commented 8 years ago

I'm using GP 2.8.1 (Pilsen) on macOS 10.12. Each time I start the app, it creates (if not already existing) two files: ganttproject.log and java0.log directly in my home directory. Is there a way to a) disable the log altogether or, b) change the directory to, say, /var/log?

I tried tinkering with the environment variable GP_LOG_DIR, I changed the Info.plist "-log" option to "false", but it only got rid of the ganttproject.log, not the java0.log.

Great app otherwise!

Thanks

chiyang10000 commented 5 years ago

Hello, I have found that modifying /Applications/GanttProject.app/Contents/Java/Classes/logging.properties helps to change the location of java0.log.

java.util.logging.FileHandler.pattern = /tmp/java%u.log

Hope this helps😃.

narekboghozian commented 3 years ago

I also find this very annoying on MacOS, although I do like the app overall.

My workaround was to run this command to hide the ganttproject.log:

chflags hidden ~/ganttproject.log 

and for the java.log I changed:

java.util.logging.FileHandler.pattern = %h/java%u.log 

to:

java.util.logging.FileHandler.pattern = %h/.ganttproject.d/logs/java%u.log 

in:

/Applications/GanttProject.app/Contents/runtime/Contents/Home/conf/logging.properties 

and made a new logs folder in .ganttproject.d. Not sure if I disabled it but it isn't there anymore. During use the ganttproject.log.lck file is still present however. If there's a fix for that too I'd like to know.

jsung commented 2 years ago

Use the -log_file option.